/**
 *@Name dtree æ ‘å½¢ç»„ä»¶
 *@Author æ™ºæ…§çš„å°è¥¿ç“œ
 *@DOCS http://www.wisdomelon.com/DTreeHelper/
 *@License https://www.layui.com/
 *@LASTTIME 2020/03/31
 *@VERSION v2.5.8
 */
layui.define(['jquery','layer','form'], function(exports) {
	var $ = layui.$,
		layer = layui.layer,
		form = layui.form;

	// æ ‘çš„å…¬å…±å®šä¹‰æ ·å¼æ±‡æ€»
	var LI_NAV_CHILD = "dtree-nav-ul-sid", LI_NAV_ITEM = "dtree-nav-item",
		LI_DIV_ITEM = "dtree-nav-div",  DTREEFONTSPECIAL="dtreefont-special", NONETITLE="dtree-none-text",
		LI_DIV_MENUBAR = "dtree-menubar",
		LI_DIV_TOOLBAR = "dtree-toolbar", TOOLBAR_TOOL = "dtree-toolbar-tool",  TOOLBAR_TOOL_EM = "dtree-toolbar-fixed",
		LI_DIV_CHECKBAR = "dtree-nav-checkbox-div",
		LI_CLICK_CHECKBAR = "d-click-checkbar",		//ç»‘å®šç‚¹å‡»å¤é€‰æ¡†æ—¶éœ€è¦ç”¨åˆ°
		LI_DIV_TEXT_CLASS = "t-click", UL_ROOT="dtree",
		LI_NAV_FIRST_LINE = "dtree-nav-first-line", LI_NAV_LINE = "dtree-nav-line", LI_NAV_LAST_LINE = "dtree-nav-last-line";


	// æ ‘çš„å…¬å…±æŒ‡å®š
	var NAV_THIS = "dtree-nav-this",	//å½“å‰èŠ‚ç‚¹
		NAV_SHOW = "dtree-nav-show",	//æ˜¾ç¤ºå­èŠ‚ç‚¹
		NAV_HIDE = "dtree-nav-hide",	//éšè—èŠ‚ç‚¹
		NAV_DIS = "dtree-disabled",		//ç¦ç”¨èŠ‚ç‚¹
		ICON_HIDE = "dtree-icon-hide",  //éšè—å›¾æ ‡
		$BODY = $("body"),				//bodyé€‰æ‹©å™¨
		$WIN = $(window),				//windowçª—å£
		$DOC = $(document),				//å½“å‰æ–‡æ¡£
		MOD_NAME = "dtree",				//æ¨¡å—åç§°
		VERSION = "v2.5.8",				//ç‰ˆæœ¬
		OPTIONS = {},					//å…¨å±€å±žæ€§é…ç½®
		DTrees = {};				    //å½“å‰è¢«å®žä¾‹åŒ–çš„æ ‘çš„é›†åˆ

	// æ ‘çš„è‡ªå®šä¹‰å›¾æ ‡
	var DTREEFONT = "dtreefont",									//é»˜è®¤ä½¿ç”¨å›¾æ ‡å­—ä½“
		LI_DIV_CHECKBAR_ON = "dtree-icon-fuxuankuangxuanzhong", 	//å¤é€‰æ¡†é€‰ä¸­å›¾æ ‡
		LI_DIV_CHECKBAR_OUT = "dtree-icon-fuxuankuang", 			//å¤é€‰æ¡†æœªé€‰ä¸­å›¾æ ‡
		LI_DIV_CHECKBAR_NOALL = "dtree-icon-fuxuankuang-banxuan",	//å¤é€‰æ¡†åŠé€‰å›¾æ ‡
		LI_DIV_MENUBAR_DOWN = "dtree-icon-move-down", 				//menubarçš„å±•å¼€å…¨éƒ¨çš„å›¾æ ‡
		LI_DIV_MENUBAR_UP = "dtree-icon-move-up", 					//menubarçš„æ”¶ç¼©å…¨éƒ¨çš„å›¾æ ‡
		LI_DIV_MENUBAR_REFRESH = "dtree-icon-refresh",				//menubarçš„åˆ·æ–°å›¾æ ‡
		LI_DIV_MENUBAR_CHECKALL = "dtree-icon-roundcheckfill", 		//menubarçš„å…¨é€‰å›¾æ ‡
		LI_DIV_MENUBAR_UNCHECKALL = "dtree-icon-roundclosefill", 	//menubarçš„å…¨ä¸é€‰å›¾æ ‡
		LI_DIV_MENUBAR_INVERTALL = "dtree-icon-roundcheck", 		//menubarçš„åé€‰å›¾æ ‡
		LI_DIV_MENUBAR_DELETE = "dtree-icon-delete1", 				//menubarçš„åˆ é™¤å›¾æ ‡
		LI_DIV_MENUBAR_SEARCH = "dtree-icon-search_list_light",		//menubarçš„æœç´¢å›¾æ ‡
		LI_DIV_TOOLBAR_PULLDOWN = "dtree-icon-pulldown", 			//toolbarçš„å±•å¼€å›¾æ ‡
		LI_DIV_TOOLBAR_PULLUP = "dtree-icon-pullup", 				//toolbarçš„æ”¶ç¼©å›¾æ ‡
		LI_DIV_TOOLBAR_ADD = "dtree-icon-roundadd", 				//toolbarçš„æ–°å¢žå›¾æ ‡
		LI_DIV_TOOLBAR_EDIT = "dtree-icon-bianji", 					//toolbarçš„ç¼–è¾‘å›¾æ ‡
		LI_DIV_TOOLBAR_DEL = "dtree-icon-roundclose";				//toolbarçš„åˆ é™¤å›¾æ ‡

	// æ ‘çš„éžå¶å­èŠ‚ç‚¹å›¾æ ‡é›†åˆ
	var nodeIconArray = {
		"-1": {"open": "dtree-icon-null-open", "close": "dtree-icon-null-close"},			//æœªæŒ‡å®š
		"0" : {"open": "dtree-icon-wenjianjiazhankai", "close": "dtree-icon-weibiaoti5"},	//æ–‡ä»¶å¤¹(äºŒçº§å›¾æ ‡é»˜è®¤æ ·å¼)
		"1" : {"open": "dtree-icon-jian", "close": "dtree-icon-jia"},						//+-å›¾æ ‡(ä¸€çº§å›¾æ ‡é»˜è®¤æ ·å¼)
		"2" : {"open": "dtree-icon-xiangxia1", "close": "dtree-icon-xiangyou"}				//ç®­å¤´å›¾æ ‡
	};

	// æ ‘çš„å¶å­èŠ‚ç‚¹å›¾æ ‡é›†åˆ
	var leafIconArray = {
		"-1": "dtree-icon-null",				//æœªæŒ‡å®š
		"0" : "dtree-icon-weibiaoti5", 			//æ–‡ä»¶å¤¹
		"1" : "dtree-icon-yonghu",				//äººå‘˜
		"2" : "dtree-icon-fenzhijigou",			//æœºæž„
		"3" : "dtree-icon-fenguangbaobiao",		//æŠ¥è¡¨
		"4" : "dtree-icon-xinxipilu",			//ä¿¡æ¯
		"5" : "dtree-icon-shuye1",				//å¶å­(äºŒçº§å›¾æ ‡é»˜è®¤æ ·å¼)
		"6" : "dtree-icon-caidan_xunzhang",	    //å‹‹ç«
		"7" : "dtree-icon-normal-file",		    //æ–‡ä»¶
		"8" : "dtree-icon-dian",				//å°åœ†ç‚¹ï¼ˆä¸€çº§å›¾æ ‡é»˜è®¤æ ·å¼ï¼‰
		"9" : "dtree-icon-set-sm",				//é½¿è½®
		"10" : "dtree-icon-rate"				//æ˜Ÿæ˜Ÿ
	};

	// æ ‘çš„è‡ªå®šä¹‰æ ·å¼
	var DTREE = "dtree-",			//è‡ªå®šä¹‰æ ·å¼å‰ç¼€
		ITEMTHIS = "-item-this",	//è‡ªå®šä¹‰æ ·å¼å½“å‰è¡Œé€‰ä¸­åŽç¼€
		ITEM = "-item",				//è‡ªå®šä¹‰æ ·å¼å½“å‰è¡ŒåŽç¼€
		DFONT = "-dtreefont",		//è‡ªå®šä¹‰æ ·å¼å›¾æ ‡æ ·å¼åŽç¼€
		FICON = "-ficon",			//è‡ªå®šä¹‰æ ·å¼ä¸€çº§å›¾æ ‡æ ·å¼åŽç¼€
		ICON = "-icon",				//è‡ªå®šä¹‰æ ·å¼äºŒçº§å›¾æ ‡æ ·å¼åŽç¼€
		CBOX = "-checkbox",			//è‡ªå®šä¹‰æ ·å¼å¤é€‰æ¡†æ ·å¼åŽç¼€
		CHS = "-choose";			//è‡ªå®šä¹‰æ ·å¼å¤é€‰æ¡†é€‰ä¸­æ ·å¼åŽç¼€

	// æ ‘è‡ªå®šä¹‰æ“ä½œäº‹ä»¶åç§°é›†åˆ	ç»‘å®šdtree-clickçš„äº‹ä»¶
	var eventName = {
		checkNodeClick: "checkNodeClick",	//ç‚¹å‡»å¤é€‰æ¡†
		itemNodeClick: "itemNodeClick"		//ç‚¹å‡»å­èŠ‚ç‚¹div
	};

	// æ ‘é»˜è®¤toolbaræä¾›çš„åŠŸèƒ½é›†åˆ	ç»‘å®šdtree-toolçš„äº‹ä»¶
	var defaultTool = {
		pulldown: "pulldown",		//ç‚¹å‡»å±•å¼€å½“å‰èŠ‚ç‚¹ä¸‹çš„å…¨éƒ¨èŠ‚ç‚¹
		pullup: "pullup",			//ç‚¹å‡»æ”¶ç¼©å½“å‰èŠ‚ç‚¹ä¸‹çš„å…¨éƒ¨èŠ‚ç‚¹
		addTool: "addToolbar",		//ç‚¹å‡»toolbaræ–°å¢ž
		editTool: "editToolbar",	//ç‚¹å‡»toolbarç¼–è¾‘
		delTool: "delToolbar"		//ç‚¹å‡»toolbaråˆ é™¤
	};

	// æ ‘é»˜è®¤menubaræä¾›çš„åŠŸèƒ½é›†åˆ	ç»‘å®šdtree-menuçš„äº‹ä»¶
	var defaultMenu = {
		moveDown: "moveDown",		//menubarå±•å¼€å…¨éƒ¨èŠ‚ç‚¹
		moveUp: "moveUp",			//menubaræ”¶ç¼©å…¨éƒ¨èŠ‚ç‚¹
		refresh: "refresh",			//menubaråˆ·æ–°æ ‘
		checkAll: "checkAll",		//menubarå…¨é€‰
		unCheckAll: "unCheckAll",	//menubarå…¨ä¸é€‰
		invertAll: "invertAll",		//menubaråé€‰
		remove: "remove",			//menubaråˆ é™¤é€‰ä¸­èŠ‚ç‚¹
		searchNode: "searchNode"	//menubaræŸ¥è¯¢èŠ‚ç‚¹
	};

	// æ ‘çš„å…¬å…±äº‹ä»¶
	var event = {
		getElemId: function(options){	// æ ¹æ®ä¼ å…¥çš„å‚æ•°èŽ·å–ID
			var elem = options.elem || "";
			var obj = options.obj || $(elem);

			if (obj.length == 0) {	//é¡µé¢ä¸­æœªæ‰¾åˆ°ç»‘å®šid
				return "";
			} else {
				return $(obj)[0].id;
			}
		},
		escape: function(html){  // ç¼–ç 
			if(typeof html !== 'string') return '';
			return html.replace(entityReg.escape, function(match){return entityMap.escape[match];});
		},
		unescape: function(str){  // è§£ç 
			if(typeof str !== 'string') return '';
			return str.replace(entityReg.unescape, function(match){return entityMap.unescape[match];});
		},
		cloneObj: function (obj, filter) {  //æ·±å¤åˆ¶å¯¹è±¡æ–¹æ³•
			var newObj = {};
			if (obj instanceof Array) {
				newObj = [];
			}
			var str = "";
			if(typeof filter !== 'undefined') {str = filter.join(",");}
			for (var key in obj) {
				if(str.indexOf(key) == -1){
					var val = obj[key];
					newObj[key] = typeof val === 'object' ? event.cloneObj(val, typeof filter !== undefined ? filter : []): val;
				}

			}
			return newObj;
		},
		trimToDot: function(str){
			return str.replace(/ /g, ".");
		}
	};

	// ç‰¹æ®Šç¬¦å·è½¬ä¹‰
	var keys = Object.keys || function(obj) {
		obj = Object(obj);
		var arr = [];
		for(var a in obj) arr.push(a);
		return arr;
	};
	var invert = function(obj){
		obj = Object(obj);
		var result = {};
		for(var a in obj) result[obj[a]] = a;
		return result;
	};
	var entityMap = {
		escape: {
			"&" : "&amp;",
			"<" : "&lt;",
			">" : "&gt;",
			"'" : "&quo;"
		}
	};
	entityMap.unescape = invert(entityMap.escape);
	var entityReg = {
		escape: RegExp('[' + keys(entityMap.escape).join('') + ']', 'g'),
		unescape: RegExp('(' + keys(entityMap.unescape).join('|') + ')', 'g')
	};

	//å¼‚æ­¥åŠ è½½æŽ¥å£
	var AjaxHelper = {
		request : function(config) {
			var data = config.data ? config.data : {};
			var async = (typeof (config.async) === "boolean") ? config.async : true;
			$.ajax({
				type : config.type ? config.type : "POST",
				headers : config.headers,
				url : config.url,
				dataType : config.dataType ? config.dataType : "json",
				data : data,
				async : async,
				contentType : config.contentType,
				xhrFields: {withCredentials: config.withCredentials},
				beforeSend: function (XMLHttpRequest, self) {
					if (typeof (config.beforeSend) === "function") {
						return config.beforeSend(XMLHttpRequest, self);
					}
					return true;
				},
				success : config.success,
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					if (typeof (config.error) === "function") {
						config.error(XMLHttpRequest, textStatus, errorThrown);
					} else {
						layer.msg("å¼‚æ­¥åŠ è½½å¤±è´¥ï¼š " + textStatus,{icon:5, shift:6});
					}
				},
				statusCode : {
					404 : function() {
						layer.msg('æœªæ‰¾åˆ°æŒ‡å®šè¯·æ±‚ï¼Œè¯·æ£€æŸ¥è®¿é—®è·¯å¾„ï¼',{icon:5, shift:6});
					},
					500 : function() {
						layer.msg('ç³»ç»Ÿé”™è¯¯ï¼',{icon:5, shift:6});
					}
				},
				complete : function(XMLHttpRequest, textStatus) {
					if (typeof (config.complete) === "function") {
						config.complete(XMLHttpRequest, textStatus);
					}
				}
			});
		},
		serialize: function(first, param){	//jsonåºåˆ—åŒ–   key=value&key1=value1
			var p = first;
			for (var key in param) {
				p += key + "=" + param[key] + "&";
			}
			p = p.substring(0, p.length-1);
			return p;
		}
	};

	/** æ ‘ç±» Classå®šä¹‰ */
	var DTree = function(options){
		var _this = this;
		/** é»˜è®¤èµ‹å€¼**/
		this.formatter = {	// æ•°æ®è¿‡æ»¤
			title: false    // æ–‡å­—ï¼Œé»˜è®¤ä¸å¼€å¯
		};
		this.response = {           // æ ‘è¿”å›žçš„jsonæ ¼å¼
			statusName: "code",		  //è¿”å›žæ ‡è¯†
			statusCode: 200,		  //è¿”å›žç 
			message: "message",		  //è¿”å›žä¿¡æ¯
			rootName: "data",		  //æ ¹èŠ‚ç‚¹åç§°
			treeId: "id",			  //èŠ‚ç‚¹ID
			parentId: "parentId",	  //çˆ¶èŠ‚ç‚¹ID
			title: "title",			  //èŠ‚ç‚¹åç§°
			ficonClass: "ficonClass", //è‡ªå®šä¹‰ä¸€çº§å›¾æ ‡
			iconClass: "iconClass",	  //è‡ªå®šä¹‰äºŒçº§å›¾æ ‡
			childName: "children",	  //å­èŠ‚ç‚¹åç§°
			last: "last",		      //æ˜¯å¦æœ€åŽä¸€çº§èŠ‚ç‚¹
//			level: "level",			  //å±‚çº§
			spread: "spread",		  //å±•å¼€
			disabled: "disabled",	  //ç¦ç”¨
			hide: "hide",		      //éšè—
			checkArr: "checkArr",	  //å¤é€‰æ¡†åˆ—è¡¨
			checked: "checked",       //æ˜¯å¦é€‰ä¸­
			type: "type",			  //å¤é€‰æ¡†æ ‡è®°
			basicData: "basicData"	  //è¡¨ç¤ºç”¨æˆ·è‡ªå®šä¹‰éœ€è¦å­˜å‚¨åœ¨æ ‘èŠ‚ç‚¹ä¸­çš„æ•°æ®
		};
		this.defaultRequest = {         // æ ‘çš„é»˜è®¤å‘èµ·è¯·æ±‚å‚æ•°æ ¼å¼ï¼Œæœ€åŽä¼šå°†valueä½œä¸ºå‚æ•°åç§°ä¼ é€’
			nodeId: "nodeId",		    //èŠ‚ç‚¹ID
			parentId: "parentId",	    //çˆ¶èŠ‚ç‚¹ID
			context: "context",	        //èŠ‚ç‚¹å†…å®¹
			leaf: "leaf",		        //æ˜¯å¦å¶å­èŠ‚ç‚¹
			level: "level",		        //å±‚çº§
			spread: "spread",		    //èŠ‚ç‚¹å±•å¼€çŠ¶æ€
			dataType: "dataType",	    //èŠ‚ç‚¹æ ‡è®°
			checked: "checked",  	    //èŠ‚ç‚¹å¤é€‰æ¡†é€‰ä¸­çŠ¶æ€
			initchecked: "initchecked",	//èŠ‚ç‚¹å¤é€‰æ¡†åˆå§‹çŠ¶æ€
			basicData: "basicData",		//ç”¨æˆ·è‡ªå®šä¹‰çš„è®°å½•èŠ‚ç‚¹æ•°æ®
			recordData: "recordData",	//å½“å‰dataæ•°æ®ï¼ˆæŽ’é™¤basicDataå’Œchildrenå­—æ®µï¼‰
		};
		this.toolbarFun = {
			addTreeNode: function(param, $div) {	//æ·»åŠ æ ‘èŠ‚ç‚¹åŽè°ƒç”¨çš„å‡½æ•°ï¼Œç”¨äºŽç”¨æˆ·è‡ªå®šä¹‰ï¼Œå¦‚æœªæŒ‡å®šåˆ™æ ‘ä¸ä¼šå‘ç”Ÿå˜åŒ–
				return ;
			},
			editTreeNode: function(param, $div) {	//ç¼–è¾‘æ ‘èŠ‚ç‚¹åŽè°ƒç”¨çš„å‡½æ•°ï¼Œç”¨äºŽç”¨æˆ·è‡ªå®šä¹‰ï¼Œå¦‚æœªæŒ‡å®šåˆ™æ ‘ä¸ä¼šå‘ç”Ÿå˜åŒ–
				return ;
			},
			editTreeLoad: function(param){	        // ç¼–è¾‘æ ‘çš„æ•°æ®å›žæ˜¾ï¼Œç”¨äºŽæ‰“å¼€ç¼–è¾‘æ—¶ï¼Œå›žå¡«æ•°æ®
				return ;
			},
			delTreeNode: function(param, $div){	    //åˆ é™¤æ ‘åŽè°ƒç”¨çš„å‡½æ•°ï¼Œç”¨äºŽç”¨æˆ·è‡ªå®šä¹‰ï¼Œå¦‚æœªæŒ‡å®šåˆ™æ ‘ä¸ä¼šå‘ç”Ÿå˜åŒ–
				return ;
			},
			loadToolbarBefore: function(buttons, param, $div){  // å³é”®èœå•åŠ è½½å‰çš„å‡½æ•°
				return buttons;
			}
		};
		this.toolbarStyle = {  // å·¥å…·æ å¼¹å‡ºå±‚çš„è‡ªå®šä¹‰æ ·å¼
			title: "èŠ‚ç‚¹",
			area: ["60%","80%"]
		};
		this.menubarFun = {
			remove: function(checkbarNodes){  //åˆ é™¤å¤é€‰æ¡†é€‰ä¸­èŠ‚ç‚¹ï¼Œéœ€è¦ç”¨æˆ·è‡ªå®šä¹‰ï¼Œå¦‚æœªæŒ‡å®šåˆ™æ ‘åªæ˜¯é¡µé¢ä¸Šåšäº†ä¿®æ”¹
				return true;
			}
		};
		this.menubarTips = {  // èœå•æ çš„é»˜è®¤æ˜¾ç¤º
			toolbar: [],
			group: [defaultMenu.moveDown, defaultMenu.moveUp, defaultMenu.refresh, defaultMenu.checkAll, defaultMenu.unCheckAll, defaultMenu.invertAll, defaultMenu.remove, defaultMenu.searchNode],
			freedom: []
		};
		this.checkbarFun = {
			chooseBefore: function($i, node){	        // å¤é€‰æ¡†ç‚¹å‡»å‰å›žè°ƒ
				return true;
			},
			chooseDone: function(checkbarNodesParam) {	//å¤é€‰æ¡†ç‚¹å‡»äº‹ä»¶å®Œæ¯•åŽï¼Œè¿”å›žè¯¥æ ‘å…³äºŽå¤é€‰æ¡†æ“ä½œçš„å…¨éƒ¨ä¿¡æ¯ï¼Œç”¨äºŽç”¨æˆ·è‡ªå®šä¹‰ï¼Œå¦‚æœªæŒ‡å®šåˆ™æ ‘åªæ˜¯é¡µé¢ä¸Šåšäº†ä¿®æ”¹
				return ;
			}
		};
		this.iframeDefaultRequest = {   //iframeçš„é»˜è®¤å‚æ•°,ç›®çš„æ˜¯ä¸ŽåŠ è½½æ ‘çš„å‚æ•°ä¸ä¸€æ ·
			nodeId: "nodeId",		    //èŠ‚ç‚¹ID
			parentId: "parentId",	    //çˆ¶èŠ‚ç‚¹ID
			context: "context",	        //èŠ‚ç‚¹å†…å®¹
			leaf: "leaf",		        //æ˜¯å¦å¶å­èŠ‚ç‚¹
			level: "level",		        //å±‚çº§
			spread: "spread",		    //èŠ‚ç‚¹å±•å¼€çŠ¶æ€
			dataType: "dataType",	    //èŠ‚ç‚¹æ ‡è®°
			checked: "checked",	        //èŠ‚ç‚¹å¤é€‰æ¡†é€‰ä¸­çŠ¶æ€
			initchecked: "initchecked",	//èŠ‚ç‚¹å¤é€‰æ¡†åˆå§‹çŠ¶æ€
			basicData: "basicData",		//ç”¨æˆ·è‡ªå®šä¹‰çš„è®°å½•èŠ‚ç‚¹æ•°æ®
			recordData: "recordData",	//å½“å‰dataæ•°æ®ï¼ˆæŽ’é™¤basicDataå’Œchildrenå­—æ®µï¼‰
		};

		this.iframeFun = {
			iframeDone: function(iframeParam){	//iframeåŠ è½½å®Œæ¯•åŽï¼Œç”¨äºŽç”¨æˆ·è‡ªå®šä¹‰äº‹ä»¶
				return ;
			}
		};
		this.style = {			//æ ‘æœ€ç»ˆä½¿ç”¨çš„æ ·å¼é›†åˆ
			item: "",			//æ¯ä¸€é¡¹divçš„æ ·å¼
			itemThis: "",		//é€‰ä¸­divçš„æ ·å¼
			dfont: "",			//ä¸€çº§å›¾æ ‡çš„æ ·å¼
			icon: "",			//äºŒçº§å›¾æ ‡çš„æ ·å¼
			cbox: "",			//å¤é€‰æ¡†çš„æ ·å¼
			chs: ""				//å¤é€‰æ¡†é€‰ä¸­çš„æ ·å¼
		};
		this.usefontStyle = {		//æ ‘æœ€ç»ˆä½¿ç”¨çš„å›¾æ ‡é›†åˆ
			fnode:{					//ä¸€çº§èŠ‚ç‚¹
				node:{				//éžå¶å­èŠ‚ç‚¹
					open:"",		//èŠ‚ç‚¹å±•å¼€
					close:""		//èŠ‚ç‚¹å…³é—­
				},
				leaf:""				//å¶å­èŠ‚ç‚¹
			},
			snode:{					//äºŒçº§èŠ‚ç‚¹
				node:{				//éžå¶å­èŠ‚ç‚¹
					open:"",		//èŠ‚ç‚¹å±•å¼€
					close:""		//èŠ‚ç‚¹å…³é—­
				},
				leaf:""				//å¶å­èŠ‚ç‚¹
			},
			checkbox:{				//å¤é€‰æ¡†
				on:"",				//å¤é€‰æ¡†é€‰ä¸­
				out:"",				//æœªé€‰ä¸­
				noall:""			//åŠé€‰
			},
			menubar:{				//èœå•æ 
				movedown:"",		//å…¨éƒ¨å±•å¼€
				moveup:"",			//å…¨éƒ¨æ”¶ç¼©
				refresh:"",			//åˆ·æ–°
				checkAll:"",		//å…¨é€‰
				unCheckAll:"",		//å…¨ä¸é€‰
				invertAll:"",		//åé€‰
				remove:"",			//åˆ é™¤
				search:""			//æœç´¢
			},
			menubarExt:"",			//æ‰©å±•èœå•æ 
			toolbar:{				//å·¥å…·æ 
				menubar:{			//ä¾é™„åœ¨èœå•æ çš„å·¥å…·æ 
					movedown:"",	//å…¨éƒ¨å±•å¼€
					moveup:"",		//å…¨éƒ¨æ”¶ç¼©
					refresh:"",		//åˆ·æ–°
					checkAll:"",	//å…¨é€‰
					unCheckAll:"",	//å…¨ä¸é€‰
					invertAll:"",	//åé€‰
					remove:"",		//åˆ é™¤
					search:""		//æœç´¢
				},
				menubarExt:"",		//ä¾é™„åœ¨èœå•æ çš„æ‰©å±•èœå•æ 
				pulldown:"",		//å±•å¼€
				pullup:"",			//æ”¶ç¼©
				add:"",				//æ·»åŠ
				edit:"",			//ç¼–è¾‘
				del:""				//åˆ é™¤
			},
			toolbarExt:""			//æ‰©å±•å·¥å…·æ 
		}

		/** æ•°æ®ç»‘å®š**/
		this.node = {		// æ ‘èŠ‚ç‚¹é€‰ä¸­æ—¶ï¼ŒåŒ…å«å½“å‰èŠ‚ç‚¹çš„å…¨éƒ¨ä¿¡æ¯
			nodeId: "",		//èŠ‚ç‚¹ID
			parentId: "",	//çˆ¶èŠ‚ç‚¹ID
			context: "",	//èŠ‚ç‚¹å†…å®¹
			leaf: "",		//æ˜¯å¦å¶å­èŠ‚ç‚¹
			level: "",		//å±‚çº§
			spread: "",		//èŠ‚ç‚¹å±•å¼€çŠ¶æ€
			dataType: "",	//èŠ‚ç‚¹æ ‡è®°
			checked: "",	//èŠ‚ç‚¹å¤é€‰æ¡†é€‰ä¸­çŠ¶æ€
			initchecked: "",	//èŠ‚ç‚¹å¤é€‰æ¡†åˆå§‹çŠ¶æ€
			basicData: "",		//ç”¨æˆ·è‡ªå®šä¹‰çš„è®°å½•èŠ‚ç‚¹æ•°æ®
			recordData: "",		//å½“å‰dataæ•°æ®ï¼ˆæŽ’é™¤basicDataå’Œchildrenå­—æ®µï¼‰
		};

		this.toolbarMenu = {};	// å·¥å…·æ å³é”®èœå•ç»‘å®šçš„æ‰€æœ‰å…ƒç´
		this.checkbarNode = [];	// å¤é€‰æ¡†æ ‡è®°çš„å…¨éƒ¨èŠ‚ç‚¹æ•°æ®
		this.errData = [];		// è®°å½•åœ¨æ¸²æŸ“èŠ‚ç‚¹æ—¶æœ‰é—®é¢˜çš„æ•°æ®
		this.checkArrLen = 0;	// æ·»åŠ èŠ‚ç‚¹çš„æ—¶åˆ¤æ–­å¤é€‰æ¡†ä¸ªæ•°
		this.temp = [];	        // ä¸´æ—¶å˜é‡
		this.bak = "";	        // ä¸´æ—¶å˜é‡
		this.setting(options);
	};

	/******************** åˆå§‹å‚æ•°åŠ è½½ ********************/
	/**
	 * @Desc: è®¾ç½®åŸºæœ¬å±žæ€§å€¼
	 * @Param: optionsï¼šJSONå¯¹è±¡ï¼Œåˆå§‹è®¾ç½®dtreeæ‰€éœ€çš„å…¨éƒ¨å±žæ€§
	 */
	DTree.prototype.setting = function(options) {
		this.options = options || {};

		/** ç»‘å®šå…ƒç´ å‚æ•°ï¼ˆå¿…å¡«ï¼Œ2ä¸ªå‚æ•°é¡¹å¿…å¡«ä¸€ä¸ªï¼‰**/
		this.elem = this.options.elem || OPTIONS.elem ||  ""; //æ ‘ç»‘å®šçš„å…ƒç´ IDï¼š#elem
		if(typeof this.options.obj === 'undefined'){
			if(this.elem) {
				if($(this.elem).length > 0) {
					this.obj = $(this.elem);
				}
			}
		} else {
			this.obj = this.options.obj || OPTIONS.obj || this.obj; //æ ‘ç»‘å®šçš„jqueryå…ƒç´ ï¼Œç”¨äºŽå½“å…ƒç´ æ˜¯å»¶è¿ŸåŠ è½½å‡ºæ¥çš„è¯ï¼Œå¯ä»¥ç”¨è¿™ä¸ªæ‰¾åˆ°
			this.elem = "#" + this.obj[0].id;
		}

		/** åŸºæœ¬å‚æ•°**/
		this.scroll = this.options.scroll || OPTIONS.scroll || this.elem; //æ ‘çš„ä¸Šçº§divå®¹å™¨ï¼Œè®©æ ‘å¯ä»¥æ˜¾ç¤ºæ»šåŠ¨æ¡çš„divå®¹å™¨çš„ID
		this.accordion = (typeof (this.options.accordion) === "boolean") ? this.options.accordion : (typeof (OPTIONS.accordion) === "boolean") ? OPTIONS.accordion : false; //æ‰‹é£Žç´åŠ è½½ï¼Œ é»˜è®¤false
		if(this.accordion) {
			this.initLevel = 1; //é»˜è®¤å±•å¼€èŠ‚ç‚¹  1èŠ‚
		} else {
			this.initLevel = this.options.initLevel || OPTIONS.initLevel || 2; //é»˜è®¤å±•å¼€èŠ‚ç‚¹  2èŠ‚
		}
		this.type = this.options.type || OPTIONS.type || "load"; //æ ‘çš„åŠ è½½æ–¹å¼  allï¼Œå…¨é‡æ ‘ï¼Œ  loadï¼Œå¢žé‡æ ‘ï¼Œé»˜è®¤load
		this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : (typeof (OPTIONS.cache) === "boolean") ? OPTIONS.cache : true; //æ•°æ®ç¼“å­˜ï¼Œé»˜è®¤true
		this.record =  this.options.record || OPTIONS.record || false; //å¼€å¯æ•°æ®è®°å½•æ¨¡å¼ï¼Œé»˜è®¤false
		this.load = (typeof (this.options.load) === "boolean") ? this.options.load : (typeof (OPTIONS.load) === "boolean") ? OPTIONS.load : true; //å¼€å¯åŠ è½½åŠ¨ç”»ï¼Œé»˜è®¤true
		this.none = this.options.none || OPTIONS.nont || "æ— æ•°æ®";	 //åˆå§‹åŠ è½½æ— è®°å½•æ—¶æ˜¾ç¤ºæ–‡å­—
		this.tempHeight = this.options.height || OPTIONS.height; //ä¸´æ—¶è½¬æ¢é«˜åº¦å˜é‡
		if(this.tempHeight) { // è®¾ç½®é«˜åº¦
			if(/^full-\d+$/.test(this.tempHeight)) {
				this.fullHeightGap = this.tempHeight.split('-')[1];
				this.height = $WIN.height() - this.fullHeightGap; //è®¾ç½®é«˜åº¦
			} else {
				this.fullHeightGap = this.tempHeight;
				this.height = this.tempHeight;
			}
		} else {
			this.fullHeightGap = "";
			this.height = "";
		}
		this.width = this.options.width || OPTIONS.width  || "260"; //å®½åº¦
		this.obj.css("width", this.width);

		/** æ ·å¼ç›¸å…³å‚æ•°**/
		this.iconfont = this.options.iconfont || OPTIONS.iconfont || DTREEFONT; //é»˜è®¤å›¾æ ‡å­—ä½“ dtreefont
		this.iconfontStyle = this.options.iconfontStyle  || OPTIONS.iconfontStyle || {}; //ç”¨äºŽè‡ªå®šä¹‰æ ‘çš„æ¯ä¸ªå…³é”®éƒ¨ä½ä½¿ç”¨çš„å›¾æ ‡
		this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray || OPTIONS.nodeIconArray) || nodeIconArray; //ç”¨æˆ·è‡ªå®šä¹‰éžå¶å­èŠ‚ç‚¹å›¾æ ‡é›†åˆï¼Œnode
		this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray || OPTIONS.leafIconArray) || leafIconArray; //ç”¨æˆ·è‡ªå®šä¹‰å¶å­èŠ‚ç‚¹å›¾æ ‡é›†åˆï¼Œleaf
		this.skin = this.options.skin || OPTIONS.skin || "theme"; // è‡ªå®šä¹‰æ ·å¼
		if(this.skin == "layui"){ // layuiä¸»é¢˜
			this.line = (typeof (this.options.line) === "boolean") ? this.options.line : (typeof (OPTIONS.line) === "boolean") ? OPTIONS.line : true; //å¼€å¯æ ‘çº¿ï¼Œé»˜è®¤å¼€å¯
			this.ficon = this.options.ficon || OPTIONS.ficon || "7"; //ä¸€çº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ã€‚é»˜è®¤'7'
			this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ï¼Œé»˜è®¤'1'
			this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; //ä¸€çº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
			this.icon = this.options.icon || OPTIONS.icon || "-1"; //äºŒçº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ã€‚é»˜è®¤'-1'
			this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'-1'
			this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
		} else if(this.skin == "laySimple"){ // laySimpleä¸»é¢˜
			this.line = this.options.line || OPTIONS.line || false; //å¼€å¯æ ‘çº¿ï¼Œé»˜è®¤ä¸å¼€å¯
			this.ficon = this.options.ficon || OPTIONS.ficon || ["2","-1"];	//ä¸€çº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ã€‚é»˜è®¤'-1'
			this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "2") : this.ficon[0]; //ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ï¼Œé»˜è®¤'2'
			this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1];	// ä¸€çº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
			this.icon = this.options.icon || OPTIONS.icon || "-1"; //äºŒçº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ã€‚é»˜è®¤'-1'
			this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'-1'
			this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
		} else { // é»˜è®¤ä¸»é¢˜  æˆ–è€…è‡ªå®šä¹‰ä¸»é¢˜
			this.line = this.options.line || OPTIONS.line || false; //å¼€å¯æ ‘çº¿ï¼Œé»˜è®¤ä¸å¼€å¯
			this.ficon = this.options.ficon || OPTIONS.ficon || "8"; //ä¸€çº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ã€‚é»˜è®¤'8'
			this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ï¼Œé»˜è®¤'1'
			this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1];	// ä¸€çº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
			this.icon = this.options.icon || OPTIONS.icon || "5"; //äºŒçº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ã€‚é»˜è®¤'5'
			this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; //äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'0'
			this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
		}

		/** æ•°æ®åŠ è½½å‚æ•°**/
		this.url = this.options.url || OPTIONS.url || ""; //è¯·æ±‚åœ°å€
		this.async = (typeof (this.options.async) === "boolean") ? this.options.async : (typeof (OPTIONS.async) === "boolean") ? OPTIONS.async : true; //å¼‚æ­¥åŒæ­¥åŠ è½½,é»˜è®¤å¼‚æ­¥åŠ è½½
		this.asyncLoad = this.options.asyncLoad || OPTIONS.asyncLoad || []; //åˆå§‹å¼‚æ­¥åŠ è½½å±‚çº§æ•°æ®
		this.headers = this.options.headers || OPTIONS.headers || {}; //ajax headerå±žæ€§
		this.method = this.options.method || OPTIONS.method || "post"; //è¯·æ±‚ç±»åž‹
		this.dataType = this.options.dataType || OPTIONS.dataType || "json"; //å‚æ•°ç±»åž‹
		this.contentType = this.options.contentType || OPTIONS.contentType || "application/x-www-form-urlencoded"; //å‘é€ä¿¡æ¯è‡³æœåŠ¡å™¨æ—¶å†…å®¹ç¼–ç ç±»åž‹
		this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest || OPTIONS.defaultRequest) || this.defaultRequest; //é»˜è®¤è¯·æ±‚å‚æ•°
		this.filterRequest = this.options.filterRequest || OPTIONS.filterRequest || [];	//è¿‡æ»¤è¯·æ±‚å‚æ•°
		this.request = this.options.request || OPTIONS.request || {}; //ç”¨æˆ·è‡ªå®šä¹‰è¯·æ±‚å‚æ•°
		this.response = $.extend(this.response, this.options.response || OPTIONS.response) || this.response; //è¿”å›žjsonæ ¼å¼
		this.data = this.options.data || OPTIONS.data || null; //åˆå§‹åŒ–æŒ‡å®šè¯¥å‚æ•°ï¼Œåˆ™ä¸ä¼šè®¿é—®å¼‚æ­¥æŽ¥å£
		this.dataFormat = this.options.dataFormat || OPTIONS.dataFormat || "levelRelationship"; //ç”¨äºŽç”¨æˆ·é…ç½®çš„dataæ•°æ®æ ¼å¼ï¼Œlistï¼šåˆ—è¡¨ï¼Œ  levelRelationshipï¼šå±‚çº§å…³ç³»ï¼Œé»˜è®¤
		this.dataStyle = this.options.dataStyle || OPTIONS.dataStyle || "defaultStyle"; //ç”¨äºŽç”¨æˆ·é…ç½®layuié€šç”¨çš„jsonæ•°æ®é£Žæ ¼,layuiStyle:layuié£Žæ ¼ï¼ŒdefaultStyleï¼šé»˜è®¤é£Žæ ¼
		this.errDataShow = this.options.errDataShow || OPTIONS.errDataShow || false; //æ˜¯å¦åœ¨é€’å½’æ•°æ®å‡ºçŽ°é”™è¯¯åŽï¼Œæ˜¾ç¤ºé”™è¯¯ä¿¡æ¯ï¼Œé»˜è®¤false
		this.withCredentials = this.options.withCredentials || OPTIONS.withCredentials || false; //æ˜¯å¦å…è®¸è·¨åŸŸè¯·æ±‚ï¼Œé»˜è®¤false
		this.beforeSend = this.options.beforeSend || OPTIONS.beforeSend || function(ajax, XMLHttpRequest, self){return true}; //å¼‚æ­¥åŠ è½½ä¹‹å‰çš„å›žè°ƒ
		this.success = this.options.success || OPTIONS.success || function(data, obj, first){}; //æ ‘åŠ è½½å®Œæ¯•åŽæ‰§è¡Œè§£æžæ ‘ä¹‹å‰çš„å›žè°ƒ
		this.done = this.options.done || OPTIONS.done || function(data, obj, first){};	 //æ ‘åŠ è½½å®Œæ¯•åŽçš„å›žè°ƒ
		this.formatter = $.extend(this.formatter, this.options.formatter || OPTIONS.formatter) || this.formatter; //æ•°æ®è¿‡æ»¤
		this.error = this.options.error || OPTIONS.error || function(XMLHttpRequest, textStatus, errorThrown){}; // å¼‚æ­¥åŠ è½½å¼‚å¸¸å›žè°ƒ
		this.complete = this.options.complete || OPTIONS.complete || function(XMLHttpRequest, textStatus){};	// å¼‚æ­¥åŠ è½½å®Œæˆå›žè°ƒ

		/** å¤é€‰æ¡†å‚æ•°**/
		this.checkbar = this.options.checkbar || OPTIONS.checkbar || false; //æ˜¯å¦å¼€å¯å¤é€‰æ¡†æ¨¡å¼
		this.checkbarLoad = this.options.checkbarLoad || OPTIONS.checkbarLoad || "node"; //å¤é€‰æ¡†ä½œç”¨èŒƒå›´ï¼Œnodeï¼šæ‰€æœ‰èŠ‚ç‚¹ï¼Œ leafï¼šæœ€åŽä¸€çº§ï¼›é»˜è®¤æ‰€æœ‰èŠ‚ç‚¹
		this.checkbarType = this.options.checkbarType || OPTIONS.checkbarType || "all";	//å¤é€‰æ¡†é€‰ä¸­å½¢å¼	allï¼šå­é›†é€‰ä¸­çˆ¶çº§ä¹Ÿé€‰ä¸­ï¼Œ  no-allï¼šå­é›†é€‰ä¸­çˆ¶çº§åŠé€‰ä¸­ï¼Œå­é›†å…¨é€‰çˆ¶çº§é€‰ä¸­ï¼Œp-cascï¼šçˆ¶çº§é€‰ä¸­å­é›†å…¨é€‰ï¼Œå­é›†æ— æ³•æ”¹å˜çˆ¶çº§é€‰ä¸­çŠ¶æ€ï¼Œ selfï¼šæ²¡æœ‰ä»»ä½•çº§è”å…³ç³»ï¼Œonlyï¼šåªèƒ½é€‰ä¸­ä¸€ä¸ªå¤é€‰æ¡†ã€‚   é»˜è®¤all
		this.checkbarData = this.options.checkbarData || OPTIONS.checkbarData || "choose"; //å¤é€‰æ¡†è®°å½•æ•°æ®ç±»åž‹å½¢å¼ï¼Œ  changeè¡¨ç¤ºè®°å½•å˜æ›´æ•°æ®ï¼Œchooseè¡¨ç¤ºè®°å½•é€‰ä¸­æ•°æ®ï¼Œallè®°å½•å…¨éƒ¨æ•°æ®ï¼ŒhalfChooseè®°å½•é€‰ä¸­å’ŒåŠé€‰ä¸­çš„æ•°æ®ï¼Œé»˜è®¤choose
		this.checkbarFun =  $.extend(this.checkbarFun, this.options.checkbarFun || OPTIONS.checkbarFun) || this.checkbarFun; //checkbaräº‹ä»¶åŠ è½½

		/** èœå•æ å‚æ•°**/
		this.menubar = this.options.menubar || OPTIONS.menubar || false; //æ˜¯å¦æ‰“å¼€èœå•æ 
		this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips || OPTIONS.menubarTips) || this.menubarTips; //èœå•æ å¸é™„ï¼Œ toolbarï¼šä¾é™„åœ¨å·¥å…·æ ï¼Œgroupï¼šä¾é™„åœ¨æŒ‰é’®ç»„ï¼Œfreedomï¼Œè‡ªç”±
		this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun || OPTIONS.menubarFun) || this.menubarFun; //menubaräº‹ä»¶åŠ è½½

		/** å·¥å…·æ å‚æ•°**/
		this.toolbar = this.options.toolbar || OPTIONS.toolbar || false; //æ˜¯å¦å¼€å¯å¯ç¼–è¾‘æ¨¡å¼
		this.toolbarWay = this.options.toolbarWay || OPTIONS.toolbarWay || "contextmenu"; //å·¥å…·æ æ˜¾ç¤ºæ–¹å¼ï¼Œcontextmenu:å³é”®ï¼Œfollow:è·ŸéšèŠ‚ç‚¹ï¼Œfixed:å›ºå®šåœ¨èŠ‚ç‚¹å³ä¾§
		this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle || OPTIONS.toolbarStyle) || this.toolbarStyle; //toolbarçš„è‡ªå®šä¹‰é£Žæ ¼ï¼Œæ ‡é¢˜ï¼Œå¼¹æ¡†å¤§å°
		this.toolbarLoad = this.options.toolbarLoad || OPTIONS.toolbarLoad || "node"; //toolbarä½œç”¨èŒƒå›´ï¼šnode:æ‰€æœ‰èŠ‚ç‚¹ï¼Œnoleaf:éžæœ€åŽä¸€çº§èŠ‚ç‚¹ï¼Œleaf:æœ€åŽä¸€çº§
		this.toolbarShow = this.options.toolbarShow || OPTIONS.toolbarShow || ["add","edit","delete"]; //toolbarä¸‰ä¸ªæŒ‰é’®è‡ªå®šä¹‰åŠ è½½
		this.toolbarBtn = this.options.toolbarBtn || OPTIONS.toolbarBtn || null; //toolbarå¢žåˆ æ”¹ä¸­å†…å®¹çš„è‡ªå®šä¹‰åŠ è½½
		this.toolbarExt = this.options.toolbarExt || OPTIONS.toolbarExt || []; //toolbaræŒ‰é’®æ‰©å±•
		this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun || OPTIONS.toolbarFun) || this.toolbarFun; //toolbaräº‹ä»¶åŠ è½½

		/** iframeæ¨¡å¼å‚æ•°**/
		this.useIframe = this.options.useIframe || OPTIONS.useIframe || false; //æ˜¯å¦åŠ è½½iframe é»˜è®¤falseï¼Œ
		this.iframeElem = this.options.iframeElem || OPTIONS.iframeElem || ""; //iframeçš„ID
		this.iframeUrl = this.options.iframeUrl || OPTIONS.iframeUrl || ""; //æ ‘å…³è”çš„iframeåœ°å€
		this.iframeLoad = this.options.iframeLoad || OPTIONS.iframeLoad || "leaf"; //ç‚¹å‡»å“ªä¸€å±‚åŠ è½½frameï¼š nodeï¼šæ‰€æœ‰èŠ‚ç‚¹ï¼Œ leafï¼šé»˜è®¤ï¼Œæœ€åŽä¸€çº§
		this.iframeDefaultRequest = $.extend(this.iframeDefaultRequest, this.options.iframeDefaultRequest || OPTIONS.iframeDefaultRequest) || this.iframeDefaultRequest; //iframeçš„é»˜è®¤ä¼ é€’å‚æ•°
		this.iframeRequest = $.extend(this.iframeRequest, this.options.iframeRequest) || $.extend(this.iframeRequest, OPTIONS.iframeRequest) || this.iframeRequest; //iframeçš„è‡ªå®šä¹‰å‚æ•°
		this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || $.extend(this.iframeFun, OPTIONS.iframeFun) || this.iframeFun;	//iframeäº‹ä»¶åŠ è½½

		/** ä¸‹æ‹‰æ ‘æ¨¡å¼å‚æ•°**/
		this.select = this.options.select || false;
		if(this.select) {
			// é‡ç½®ä¸‹æ‹‰æ ‘
			this.selectSetting();
		}

		/** è°ƒç”¨ç¡®è®¤æœ€ç»ˆä¸»é¢˜æ–¹æ³•*/
		this.ensureTheme();
	};

	/**
	 * @Desc: é‡ç½®åŸºæœ¬å±žæ€§å€¼
	 * @Param: optionsï¼šJSONå¯¹è±¡ï¼Œé‡ç½®dtreeæ‰€éœ€çš„å…¨éƒ¨å±žæ€§
	 */
	DTree.prototype.reloadSetting = function(options) {
		this.options = $.extend(this.options, options) || this.options;

		/** ç»‘å®šå…ƒç´ å‚æ•°**/
		this.elem = this.options.elem || this.elem;	  //æ ‘ç»‘å®šçš„å…ƒç´ IDï¼š#elem
		if(typeof this.options.obj === 'undefined'){
			if(this.elem) {
				if($(this.elem).length > 0) {
					this.obj = $(this.elem);
				}
			}
		} else {
			this.obj = this.options.obj || this.obj; //æ ‘ç»‘å®šçš„jqueryå…ƒç´ ï¼Œç”¨äºŽå½“å…ƒç´ æ˜¯å»¶è¿ŸåŠ è½½å‡ºæ¥çš„è¯ï¼Œå¯ä»¥ç”¨è¿™ä¸ªæ‰¾åˆ°
			this.elem = "#" + this.obj[0].id;
		}

		/** åŸºæœ¬å‚æ•°**/
		this.scroll = this.options.scroll || this.scroll; //æ ‘çš„ä¸Šçº§divå®¹å™¨ï¼Œè®©æ ‘å¯ä»¥æ˜¾ç¤ºæ»šåŠ¨æ¡çš„divå®¹å™¨
		this.accordion = (typeof (this.options.accordion) === "boolean") ? this.options.accordion : this.accordion; //å¼€å¯æ‰‹é£Žç´åŠ è½½
		if(this.accordion) {
			this.initLevel = 1; //é»˜è®¤å±•å¼€èŠ‚ç‚¹  1èŠ‚
		} else {
			this.initLevel = this.options.initLevel || this.initLevel; //é»˜è®¤å±•å¼€èŠ‚ç‚¹  2èŠ‚
		}
		this.type = this.options.type || this.type; //æ ‘çš„åŠ è½½æ–¹å¼  allï¼Œå…¨é‡æ ‘ï¼Œ  loadï¼Œå¢žé‡æ ‘ï¼Œé»˜è®¤load
		this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : this.cache; //å¼€å¯æ•°æ®ç¼“å­˜
		this.record = (typeof (this.options.record) === "boolean") ? this.options.record : this.record; //å¼€å¯æ•°æ®è®°å½•æ¨¡å¼
		this.load = (typeof (this.options.load) === "boolean") ? this.options.load : this.load; //å¼€å¯åŠ è½½åŠ¨ç”»
		this.none = this.options.none || this.none;  //åˆå§‹èŠ‚ç‚¹åŠ è½½æ— æ•°æ®æ—¶æ˜¾ç¤ºæ–‡å­—
		this.tempHeight = this.options.height || this.height; //ä¸´æ—¶è½¬æ¢é«˜åº¦å˜é‡
		if(this.tempHeight) {  //è®¾ç½®é«˜åº¦
			if(/^full-\d+$/.test(this.tempHeight)) {
				this.fullHeightGap = this.tempHeight.split('-')[1];
				this.height = $WIN.height() - this.fullHeightGap;
			} else {
				this.fullHeightGap = this.tempHeight;
				this.height = this.tempHeight;
			}
		}
		this.width = this.options.width || this.width; //å®½åº¦
		this.obj.css("width", this.width);

		/** æ ·å¼ç›¸å…³å‚æ•°**/
		this.line = (typeof (this.options.line) === "boolean") ? this.options.line : this.line; //å¼€å¯æ ‘çº¿ï¼Œé»˜è®¤ä¸å¼€å¯
		this.iconfont = this.options.iconfont || this.iconfont; //é»˜è®¤å›¾æ ‡å­—ä½“ dtreefont
		this.iconfontStyle = this.options.iconfontStyle || this.iconfontStyle; //ç”¨äºŽè‡ªå®šä¹‰æ ‘çš„æ¯ä¸ªå…³é”®éƒ¨ä½ä½¿ç”¨çš„å›¾æ ‡
		this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray) || this.nodeIconArray;	//ç”¨æˆ·è‡ªå®šä¹‰éžå¶å­èŠ‚ç‚¹å›¾æ ‡é›†åˆï¼Œnode
		this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray) || this.leafIconArray;	//ç”¨æˆ·è‡ªå®šä¹‰å¶å­èŠ‚ç‚¹å›¾æ ‡é›†åˆï¼Œleaf
		this.skin = this.options.skin || this.skin;	//è‡ªå®šä¹‰æ ·å¼
		if(this.skin == "layui"){ //layuiä¸»é¢˜
			this.line = (typeof (this.options.line) === "boolean") ? this.options.line : true; //å¼€å¯æ ‘çº¿ï¼Œé»˜è®¤å¼€å¯
			this.ficon = this.options.ficon || this.ficon; //ä¸€çº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ã€‚é»˜è®¤'7'
			this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'1'
			this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; //ä¸€çº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
			this.icon = this.options.icon || this.icon;	//äºŒçº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ã€‚é»˜è®¤'-1'
			this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'-1'
			this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
		} else if(this.skin == "laySimple"){ //laySimpleä¸»é¢˜
			this.line = (typeof (this.options.line) === "boolean") ? this.options.line : false; //å¼€å¯æ ‘çº¿ï¼Œé»˜è®¤ä¸å¼€å¯
			this.ficon = this.options.ficon || this.ficon; //ä¸€çº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ã€‚é»˜è®¤'-1'
			this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "2") : this.ficon[0]; //ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'2'
			this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1];//ä¸€çº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
			this.icon = this.options.icon || this.icon;	//äºŒçº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ã€‚é»˜è®¤'-1'
			this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; //äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'-1'
			this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
		} else { // é»˜è®¤ä¸»é¢˜  æˆ–è€…è‡ªå®šä¹‰ä¸»é¢˜
			this.line = (typeof (this.options.line) === "boolean") ? this.options.line : false; //å¼€å¯æ ‘çº¿ï¼Œé»˜è®¤ä¸å¼€å¯
			this.ficon = this.options.ficon || this.ficon; //ä¸€çº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºä¸€çº§å›¾æ ‡ã€‚é»˜è®¤'8'
			this.fnodeIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? (this.ficon == "-1" ? "-1" : "1") : this.ficon[0]; //ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'1'
			this.fleafIcon = (typeof this.ficon === 'string' || typeof this.ficon === 'number') ? this.ficon : this.ficon[1]; // ä¸€çº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
			this.icon = this.options.icon || this.icon;	//äºŒçº§å›¾æ ‡æ ·å¼ï¼Œ0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼šäººå‘˜ï¼Œ2ï¼šæœºæž„ï¼Œ3ï¼šæŠ¥è¡¨ï¼Œ4ï¼šä¿¡æ¯ï¼Œ5ï¼šå¶å­ï¼Œ6ï¼šå‹‹ç« ï¼Œ7ï¼šæ–‡ä»¶ï¼Œ8ï¼šå°åœ†ç‚¹ï¼Œ9ï¼šé½¿è½®ï¼Œ10ï¼šæ˜Ÿæ˜Ÿï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ã€‚é»˜è®¤'5'
			this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; //äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹å›¾æ ‡ã€‚0ï¼šæ–‡ä»¶å¤¹ï¼Œ1ï¼š+ã€-ï¼Œ2ï¼šä¸‰è§’å½¢ï¼Œ -1ï¼šä¸æ˜¾ç¤ºäºŒçº§å›¾æ ‡ï¼Œé»˜è®¤'0'
			this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; //äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
		}

		/** æ•°æ®åŠ è½½å‚æ•°**/
		this.url = this.options.url || this.url; //è¯·æ±‚åœ°å€
		this.async = (typeof (this.options.async) === "boolean") ? this.options.async : this.async;	//å¼‚æ­¥åŒæ­¥åŠ è½½,é»˜è®¤å¼‚æ­¥åŠ è½½
		this.asyncLoad = this.options.asyncLoad || this.asyncLoad; //åˆå§‹å¼‚æ­¥åŠ è½½å±‚çº§æ•°æ®
		this.headers = this.options.headers || this.headers; //ajax headerå±žæ€§
		this.method = this.options.method || this.method; //è¯·æ±‚ç±»åž‹
		this.dataType = this.options.dataType || this.dataType; //å‚æ•°ç±»åž‹
		this.contentType = this.options.contentType || this.contentType; //å‘é€ä¿¡æ¯è‡³æœåŠ¡å™¨æ—¶å†…å®¹ç¼–ç ç±»åž‹
		this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest) || this.defaultRequest; //é»˜è®¤è¯·æ±‚å‚æ•°
		this.filterRequest = this.options.filterRequest || this.filterRequest; //è¿‡æ»¤è¯·æ±‚å‚æ•°
		this.request = this.options.request || this.request; //ç”¨æˆ·è‡ªå®šä¹‰è¯·æ±‚å‚æ•°
		this.response = $.extend(this.response, this.options.response) || this.response; //è¿”å›žjsonæ ¼å¼
		this.data = this.options.data || this.data; //åˆå§‹åŒ–æŒ‡å®šè¯¥å‚æ•°ï¼Œåˆ™ä¸ä¼šè®¿é—®å¼‚æ­¥æŽ¥å£
		this.dataFormat = this.options.dataFormat || this.dataFormat; //ç”¨äºŽç”¨æˆ·é…ç½®çš„dataæ•°æ®æ ¼å¼ï¼Œlistï¼šåˆ—è¡¨ï¼Œ  levelRelationshipï¼šå±‚çº§å…³ç³»ï¼Œé»˜è®¤
		this.dataStyle = this.options.dataStyle || this.dataStyle; //ç”¨äºŽç”¨æˆ·é…ç½®layuié€šç”¨çš„jsonæ•°æ®é£Žæ ¼,layuiStyle:layuié£Žæ ¼ï¼ŒdefaultStyleï¼šé»˜è®¤é£Žæ ¼
		this.errDataShow = (typeof (this.options.errDataShow) === "boolean") ? this.options.errDataShow : this.errDataShow; //æ˜¯å¦åœ¨ä½¿ç”¨listæ¨¡å¼é€’å½’æ•°æ®å‡ºçŽ°é”™è¯¯æ—¶ï¼Œæ˜¾ç¤ºé”™è¯¯ä¿¡æ¯
		this.withCredentials = (typeof (this.options.withCredentials) === "boolean") ? this.options.withCredentials : this.withCredentials; //æ˜¯å¦å…è®¸è·¨åŸŸè¯·æ±‚
		this.beforeSend = this.options.beforeSend || this.beforeSend; //å¼‚æ­¥åŠ è½½ä¹‹å‰çš„å›žè°ƒ
		this.success = this.options.success || this.success; //æ ‘åŠ è½½å®Œæ¯•åŽæ‰§è¡Œè§£æžæ ‘ä¹‹å‰çš„å›žè°ƒ
		this.done = this.options.done || this.done; //æ ‘åŠ è½½å®Œæ¯•åŽçš„å›žè°ƒ
		this.formatter = $.extend(this.formatter, this.options.formatter)|| this.formatter; //æ•°æ®è¿‡æ»¤
		this.error = this.options.error || this.error; //å¼‚æ­¥åŠ è½½å¼‚å¸¸å›žè°ƒ
		this.complete = this.options.complete || this.complete; //å¼‚æ­¥åŠ è½½å®Œæˆå›žè°ƒ

		/** å¤é€‰æ¡†å‚æ•°**/
		this.checkbar = this.options.checkbar || this.checkbar; //æ˜¯å¦å¼€å¯å¤é€‰æ¡†æ¨¡å¼
		this.checkbarLoad = this.options.checkbarLoad || this.checkbarLoad; //å¤é€‰æ¡†ä½œç”¨èŒƒå›´ï¼Œnodeï¼šæ‰€æœ‰èŠ‚ç‚¹ï¼Œ leafï¼šæœ€åŽä¸€çº§ï¼›é»˜è®¤æ‰€æœ‰èŠ‚ç‚¹
		this.checkbarType = this.options.checkbarType || this.checkbarType;	//å¤é€‰æ¡†é€‰ä¸­å½¢å¼	allï¼šå­é›†é€‰ä¸­çˆ¶çº§ä¹Ÿé€‰ä¸­ï¼Œ  no-allï¼šå­é›†é€‰ä¸­çˆ¶çº§åŠé€‰ä¸­ï¼Œå­é›†å…¨é€‰çˆ¶çº§é€‰ä¸­ï¼Œp-cascï¼šçˆ¶çº§é€‰ä¸­å­é›†å…¨é€‰ï¼Œå­é›†æ— æ³•æ”¹å˜çˆ¶çº§é€‰ä¸­çŠ¶æ€ï¼Œ selfï¼šæ²¡æœ‰ä»»ä½•çº§è”å…³ç³»ï¼Œonlyï¼šåªèƒ½é€‰ä¸­ä¸€ä¸ªå¤é€‰æ¡†ã€‚   é»˜è®¤all
		this.checkbarData = this.options.checkbarData || this.checkbarData; //å¤é€‰æ¡†è®°å½•æ•°æ®ç±»åž‹å½¢å¼ï¼Œ  changeè¡¨ç¤ºè®°å½•å˜æ›´æ•°æ®ï¼Œchooseè¡¨ç¤ºè®°å½•é€‰ä¸­æ•°æ®ï¼Œallè®°å½•å…¨éƒ¨æ•°æ®ï¼ŒhalfChooseè®°å½•é€‰ä¸­å’ŒåŠé€‰ä¸­çš„æ•°æ®ï¼Œé»˜è®¤choose
		this.checkbarFun =  $.extend(this.checkbarFun, this.options.checkbarFun)|| this.checkbarFun; //checkbaräº‹ä»¶åŠ è½½

		/** èœå•æ å‚æ•°**/
		this.menubar = this.options.menubar || this.menubar; //æ˜¯å¦æ‰“å¼€èœå•æ 
		this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips) || this.menubarTips; //èœå•æ å¸é™„ï¼Œ toolbarï¼šä¾é™„åœ¨å·¥å…·æ ï¼Œgroupï¼šä¾é™„åœ¨æŒ‰é’®ç»„ï¼Œfreedomï¼Œè‡ªç”±
		this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun) || this.menubarFun; //menubaräº‹ä»¶åŠ è½½

		/** å·¥å…·æ å‚æ•°**/
		this.toolbar = this.options.toolbar || this.toolbar; //æ˜¯å¦å¼€å¯å·¥å…·æ 
		this.toolbarWay = this.options.toolbarWay || this.toolbarWay; //å·¥å…·æ æ˜¾ç¤ºæ–¹å¼ï¼Œcontextmenu:å³é”®ï¼Œfollow:è·ŸéšèŠ‚ç‚¹ï¼Œfixed:å›ºå®šåœ¨èŠ‚ç‚¹å³ä¾§
		this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle) || this.toolbarStyle; //toolbarçš„è‡ªå®šä¹‰é£Žæ ¼ï¼Œæ ‡é¢˜ï¼Œå¼¹æ¡†å¤§å°
		this.toolbarLoad = this.options.toolbarLoad || this.toolbarLoad; //toolbarä½œç”¨èŒƒå›´ï¼šnode:æ‰€æœ‰èŠ‚ç‚¹ï¼Œnoleaf:éžæœ€åŽä¸€çº§èŠ‚ç‚¹ï¼Œleaf:æœ€åŽä¸€çº§
		this.toolbarShow = this.options.toolbarShow || this.toolbarShow; //toolbarä¸‰ä¸ªæŒ‰é’®
		this.toolbarBtn = this.options.toolbarBtn || this.toolbarBtn; //toolbarå¢žåˆ æ”¹ä¸­å†…å®¹çš„è‡ªå®šä¹‰åŠ è½½
		this.toolbarExt = this.options.toolbarExt || this.toolbarExt; //toolbaræŒ‰é’®æ‰©å±•
		this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun) || this.toolbarFun; //toolbaräº‹ä»¶åŠ è½½

		/** iframeæ¨¡å¼å‚æ•°**/
		this.useIframe = this.options.useIframe || this.useIframe;//æ˜¯å¦åŠ è½½iframe é»˜è®¤false
		this.iframeElem = this.options.iframeElem || this.iframeElem; //iframeçš„ID
		this.iframeUrl = this.options.iframeUrl || this.iframeUrl; //æ ‘å…³è”çš„iframeåœ°å€
		this.iframeLoad = this.options.iframeLoad || this.iframeLoad; //ç‚¹å‡»å“ªä¸€å±‚åŠ è½½frameï¼š nodeï¼šæ‰€æœ‰èŠ‚ç‚¹ï¼Œ leafï¼šé»˜è®¤ï¼Œæœ€åŽä¸€çº§
		this.iframeDefaultRequest = $.extend(this.iframeDefaultRequest, this.options.iframeDefaultRequest) || this.iframeDefaultRequest; //iframeçš„é»˜è®¤ä¼ é€’å‚æ•°
		this.iframeRequest = $.extend(this.iframeRequest, this.options.iframeRequest) || this.iframeRequest; //iframeçš„è‡ªå®šä¹‰å‚æ•°
		this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || this.iframeFun; //iframeäº‹ä»¶åŠ è½½

		/** ä¸‹æ‹‰æ ‘æ¨¡å¼å‚æ•°**/
		if(this.select) {
			// é‡ç½®ä¸‹æ‹‰æ ‘
			this.reloadSelectSetting();
		}

		/** è°ƒç”¨ç¡®è®¤æœ€ç»ˆä¸»é¢˜æ–¹æ³•*/
		this.ensureTheme();

	};

	/**
	 * @Desc: è®¾ç½®ä¸‹æ‹‰æ ‘çš„åŸºæœ¬å‚æ•°å€¼
	 */
	DTree.prototype.selectSetting = function() {
		/** selectæ¨¡å¼å‚æ•°*/
		this.select = true; //é…ç½®æˆselectæ¨¡å¼

		this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || "";	//è¾“å…¥æ¡†çš„å€¼
		this.selectTreeDiv = this.obj[0].id + "_tree_div";		// ä¸Šçº§DIVèŠ‚ç‚¹
		this.selectCardDiv = this.obj[0].id + "_select_card_div";	// ä¸Šçº§layuiå¡ç‰‡èŠ‚ç‚¹
		this.selectDiv = this.obj[0].id + "_select_div";		// æ¨¡æ‹Ÿçš„selectèŠ‚ç‚¹
		this.selectTipsName = this.obj[0].id + "_select_input"; // selectçš„æç¤ºè¾“å…¥æ¡†åç§°
		this.selectTips = this.options.selectTips || "è¯·é€‰æ‹©";			// è¾“å…¥æ¡†çš„æç¤ºè¯­
		this.selectCardHeight = this.options.selectCardHeight || "350";			// ä¸‹æ‹‰é¢æ¿çš„é«˜åº¦
		this.selectInputName = this.options.selectInputName || {nodeId: this.obj[0].id + "_select_nodeId"};  // selectè¡¨å•ä¸­çš„å…ƒç´

		// è°ƒå–ä¸‹æ‹‰æ ‘çš„ç‰¹æ®Šå¤„ç†é¡µé¢å…ƒç´ æ ‡è¯†
		this.renderSelectDom();
	}

	/**
	 * @Desc: é‡ç½®ä¸‹æ‹‰æ ‘çš„åŸºæœ¬å‚æ•°å€¼
	 */
	DTree.prototype.reloadSelectSetting = function() {

		this.selectInitVal = this.obj.attr("data-value") || this.options.selectInitVal || this.selectInitVal;	//è¾“å…¥æ¡†çš„å€¼
		this.selectTips = this.options.selectTips || this.selectTips;			// è¾“å…¥æ¡†çš„æç¤ºè¯­
		this.selectCardHeight = this.options.selectCardHeight || this.selectCardHeight;			// ä¸‹æ‹‰é¢æ¿çš„é«˜åº¦
		this.selectInputName = $.extend(this.selectInputName, this.options.selectInputName) || this.selectInputName;  // selectè¡¨å•ä¸­çš„å…ƒç´

		// è°ƒå–ä¸‹æ‹‰æ ‘çš„ç‰¹æ®Šå¤„ç†é¡µé¢å…ƒç´ æ ‡è¯†
		this.reloadSelectDom();
	}

	/******************** ä¸‹æ‹‰æ ‘è®¾ç½®åŒºåŸŸ ********************/
	/**
	 * @Desc: æ¸²æŸ“ä¸‹æ‹‰æ ‘çš„Domç»“æž„
	 */
	DTree.prototype.renderSelectDom = function() {
		var _this = this;
		var rootId = _this.obj[0].id;

		// è®¾ç½®è‡ªå®šä¹‰è¡¨å•éšè—åŸŸ
		var selectInputName = _this.selectInputName;
		var selectInput = [];
		for(var key in selectInputName) {
			selectInput.push('<input type="hidden" dtree-id="' + rootId + '" dtree-node="' + key + '" name="' + selectInputName[key] + '" value="" readonly>');
		}

		// è®¾ç½®html
		var prevHtml = ['<div class="layui-unselect layui-form-select" dtree-id="' + rootId + '" dtree-select="' + _this.selectDiv + '">',
			'<div class="layui-select-title">', selectInput.join(""),
			'<input type="text" dtree-id="' + rootId + '" id="' +  _this.selectTipsName +'_id" name="' + _this.selectTipsName + '" placeholder="' + _this.selectTips + '" value="" readonly class="layui-input layui-unselect">',
			'<i class="layui-edge"></i>',
			'</div></div>'].join('');

		_this.obj.before(prevHtml);

		var cardStyle = "style=";
		if(this.selectCardHeight) {
			cardStyle += "'height:"+_this.selectCardHeight+"px'";
		}
		_this.obj.wrap('<div class="layui-card dtree-select" dtree-id="' + rootId + '" dtree-card="' + _this.selectCardDiv + '" ' + cardStyle + '></div>').wrap('<div class="layui-card-body"></div>').wrap('<div id="' + _this.selectTreeDiv + '"></div>');

	}

	/**
	 * @Desc: é‡æ–°æ¸²æŸ“ä¸‹æ‹‰æ ‘çš„Domç»“æž„
	 */
	DTree.prototype.reloadSelectDom = function() {
		var _this = this;
		var rootId = _this.obj[0].id;

		// è®¾ç½®è‡ªå®šä¹‰è¡¨å•éšè—åŸŸ
		var selectInputName = _this.selectInputName;
		var selectInput = [];
		for(var key in selectInputName) {
			selectInput.push('<input type="hidden" dtree-id="' + rootId + '" dtree-node="' + key + '" name="' + selectInputName[key] + '" value="" readonly>');
		}

		$("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html("");

		// è®¾ç½®html
		var prevHtml = [selectInput.join(""),
			'<input type="text" dtree-id="' + rootId + '" id="' +  _this.selectTipsName +'_id" name="' + _this.selectTipsName + '" placeholder="' + _this.selectTips + '" value="" readonly class="layui-input layui-unselect">',
			'<i class="layui-edge"></i>'].join('');

		$("div[dtree-id='"+rootId+"'][dtree-select='"+_this.selectDiv+"']").find("div.layui-select-title").html(prevHtml);

		var cardStyle = "style=";
		if(this.selectCardHeight) {
			cardStyle += "'height:"+_this.selectCardHeight+"px'";
		}
		$("div[dtree-id='"+rootId+"'][dtree-card='"+_this.selectCardDiv+"']").attr("style", cardStyle);
	}

	/**
	 * @Desc: è®¾ç½®ä¸‹æ‹‰æ ‘æ¨¡å¼ä¸­ï¼Œinputè¾“å…¥æ¡†çš„å€¼
	 * @Param: paramï¼š inputä¸­çš„å€¼å¯¹åº”æ ‘æ•°æ®çš„IDå€¼\å½“å‰æ ‘é€‰ä¸­çš„æ•°æ®JSONå¯¹è±¡ï¼Œå¯ä¸ä¼ ï¼Œä¸ä¼ çš„è¯åˆ™æ ‘å†…éƒ¨è¯»å–
	 */
	DTree.prototype.selectVal = function(param) {
		var _this = this;
		var rootId = _this.obj[0].id;
		var selectInputName = _this.selectInputName;
		var selectTipsNameValue = "";
		var selectValues = {};

		// å¦‚æžœå¼€å¯äº†å¤é€‰æ¡†ï¼Œåˆ™æ­¤æ–¹æ³•ç”¨æ¥å–å€¼
		if(_this.checkbar) {
			return _this.selectCheckboxVal();
		}

		if(typeof param === 'undefined') { // ä¸ä¼ ï¼Œåˆ™ä¸ºå½“å‰æ ‘ä¸­è®°å½•çš„ID
			param = _this.getNowParam();
		}
		if(typeof param === 'string') {    // ä¼ é€’IDï¼Œåˆ™æŸ¥è¯¢æ ‘èŠ‚ç‚¹IDå¯¹åº”çš„å€¼
			param = _this.getParam(param);
		}

		selectTipsNameValue = param["context"];
		for(var key in selectInputName) {
			selectValues[selectInputName[key]] = param[key];
			$("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(param[key] || "");
		}

		if(param["nodeId"] && !param["context"]) {
			selectTipsNameValue = _this.getParam(param["nodeId"]);
		}

		// è¿”æ˜¾æç¤ºè¾“å…¥æ¡†å€¼
		$("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue || "");

		// è¿”å›žéšè—åŸŸä¸­çš„å€¼
		return selectValues;
	}

	/**
	 * @Desc: è®¾ç½®å¤é€‰æ¡†æ¨¡å¼ä¸­çš„ä¸‹æ‹‰æ ‘çš„é€‰ä¸­å€¼
	 */
	DTree.prototype.selectCheckboxVal = function() {
		var _this = this;
		var rootId = _this.obj[0].id;
		var selectInputName = _this.selectInputName;

		// èŽ·å–å…¨éƒ¨å¤é€‰æ¡†é€‰ä¸­èŠ‚ç‚¹
		var param = _this.getCheckbarJsonArrParam();

		selectTipsNameValue = param["context"];
		var selectValues = {};
		for(var key in selectInputName) {
			var value = param[key].join(",");
			selectValues[selectInputName[key]] = value;
			$("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+selectInputName[key]+"']").val(value);
		}

		$("div[dtree-select='" + _this.selectDiv + "']").find("input[dtree-id='" + rootId + "'][name='"+_this.selectTipsName+"']").val(selectTipsNameValue);

		// è¿”å›žéšè—åŸŸä¸­çš„å€¼
		return selectValues;
	}

	/**
	 * @Desc: é‡ç½®ä¸‹æ‹‰æ ‘çš„å€¼ï¼Œ1.è¡¨å•æ¸…ç©ºï¼›2.èŠ‚ç‚¹é‡ç½®ï¼›3.å¤é€‰æ¡†é‡ç½®
	 */
	DTree.prototype.selectResetVal = function() {
		var _this = this;
		var rootId = _this.obj[0].id;
		// è¡¨å•æ¸…ç©º
		$("input[dtree-id='"+rootId+"']").val("");
		// èŠ‚ç‚¹é‡ç½®
		_this.cancelNavThis();
		if(_this.checkbar) {
			// å¤é€‰æ¡†é‡ç½®
			_this.cancelCheckedNode();
		}
	}


	/******************** å­—ä½“åŠå›¾æ ‡åŒºåŸŸ ********************/
	/**
	 * @Desc: æ ‘ä½¿ç”¨çš„æœ€ç»ˆä¸»é¢˜æ–¹æ¡ˆ
	 */
	DTree.prototype.ensureTheme = function(){
		var _this = this;

		// ç¡®è®¤style
		this.style.item = DTREE + this.skin + ITEM;
		this.style.itemThis = DTREE + this.skin + ITEMTHIS;
		this.style.dfont = DTREE + this.skin + DFONT;
		this.style.ficon = DTREE + this.skin + FICON;
		this.style.icon = DTREE + this.skin + ICON;
		this.style.cbox = DTREE + this.skin + CBOX;
		this.style.chs = DTREE + this.skin + CHS;

		// ç¡®è®¤usefontStyle
		var iconfont = this.iconfont;
		var iconfonts = [];
		if(typeof iconfont === 'string') {
			iconfonts.push(iconfont);
		} else {
			iconfonts = iconfont;
		}

		var iconfontStyle = this.iconfontStyle;
		var iconfontStyles = [];
		if(iconfontStyle.length == undefined) {
			iconfontStyles.push(iconfontStyle);
		} else {
			iconfontStyles = iconfontStyle;
		}

		for(var i=0; i<iconfonts.length; i++){
			var ifont = iconfonts[i];
			var ifontStyle = iconfontStyles[i];
			if(typeof ifontStyle !== 'undefined') {
				// åˆ¤æ–­ï¼Œèµ‹å€¼
				this.useDefaultOrUserDefineFnodeStyle(ifont, ifontStyle.fnode);
				this.useDefaultOrUserDefineSnodeStyle(ifont, ifontStyle.snode);
				this.useDefaultOrUserDefineCheckboxStyle(ifont, ifontStyle.checkbox);
				this.useDefaultOrUserDefineMenubarStyle(ifont, ifontStyle.menubar);
				this.useDefaultOrUserDefineMenubarExtStyle(ifont, ifontStyle.menubarExt);
				this.useDefaultOrUserDefineToolbarStyle(ifont, ifontStyle.toolbar);
				this.useDefaultOrUserDefineToolbarExtStyle(ifont, ifontStyle.toolbarExt);
			}
		}
	};

	/**
	 * @Desc: èµ‹å€¼ä¸€çº§å›¾æ ‡çš„classå±žæ€§å˜é‡
	 * @Param: ifontï¼š å½“å‰çš„å›¾æ ‡classå‰ç¼€ï¼Œå¦‚ dtreefont
	 * @Param: fnodeï¼š å½“å‰çš„å›¾æ ‡classå®žé™…å›¾æ ‡ï¼Œå¦‚ dtree-icon-jia1
	 */
	DTree.prototype.useDefaultOrUserDefineFnodeStyle = function(ifont, fnode){
		var _this = this;
		var tempOpen = this.usefontStyle.fnode.node.open;
		var tempClose = this.usefontStyle.fnode.node.close;
		var tempLeaf = this.usefontStyle.fnode.leaf;

		if(typeof fnode === 'undefined'){
			this.usefontStyle.fnode.node.open = (tempOpen == "") ? (ifont + " " + this.nodeIconArray[this.fnodeIcon]["open"]) : tempOpen; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹openå›¾æ ‡
			this.usefontStyle.fnode.node.close = (tempClose == "") ? (ifont + " " + this.nodeIconArray[this.fnodeIcon]["close"]) : tempClose; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹closeå›¾æ ‡
			this.usefontStyle.fnode.leaf = (tempLeaf == "") ? (ifont + " " + this.leafIconArray[this.fleafIcon]) : tempLeaf; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹çš„leafå›¾æ ‡
		} else {
			var node = fnode.node;
			var leaf = fnode.leaf;
			if(typeof node === 'undefined'){
				this.usefontStyle.fnode.node.open = (tempOpen == "") ? (ifont + " " + this.nodeIconArray[this.fnodeIcon]["open"]) : tempOpen; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹openå›¾æ ‡
				this.usefontStyle.fnode.node.close = (tempClose == "") ? (ifont + " " + this.nodeIconArray[this.fnodeIcon]["close"]) : tempClose; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹closeå›¾æ ‡
			} else {
				var open = node.open;
				var close = node.close;
				if(typeof open === 'undefined'){
					this.usefontStyle.fnode.node.open = (tempOpen == "") ? (ifont + " " + this.nodeIconArray[this.fnodeIcon]["open"]) : tempOpen; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹openå›¾æ ‡
				} else {
					this.usefontStyle.fnode.node.open = ifont + " " + open;
				}
				if(typeof close === 'undefined') {
					this.usefontStyle.fnode.node.close = (tempClose == "") ? (ifont + " " + this.nodeIconArray[this.fnodeIcon]["close"]) : tempClose; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹closeå›¾æ ‡
				} else {
					this.usefontStyle.fnode.node.close = ifont + " " + close;
				}
			}
			if(typeof leaf === 'undefined'){
				this.usefontStyle.fnode.leaf = (tempLeaf == "") ? (ifont + " " + this.leafIconArray[this.fleafIcon]) : tempLeaf; // ä¸€çº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹çš„leafå›¾æ ‡
			} else {
				this.usefontStyle.fnode.leaf = ifont + " " + leaf;
			}
		}
	};

	/**
	 * @Desc: èµ‹å€¼äºŒçº§å›¾æ ‡çš„classå±žæ€§å˜é‡
	 * @Param: ifontï¼š å½“å‰çš„å›¾æ ‡classå‰ç¼€ï¼Œå¦‚ dtreefont
	 * @Param: snodeï¼š å½“å‰çš„å›¾æ ‡classå®žé™…å›¾æ ‡ï¼Œå¦‚ dtree-icon-jia1
	 */
	DTree.prototype.useDefaultOrUserDefineSnodeStyle = function(ifont, snode){
		var _this = this;
		var tempOpen = this.usefontStyle.snode.node.open;
		var tempClose = this.usefontStyle.snode.node.close;
		var tempLeaf = this.usefontStyle.snode.leaf;

		if(typeof snode === 'undefined'){
			this.usefontStyle.snode.node.open = (tempOpen == "") ? (ifont + " " + this.nodeIconArray[this.nodeIcon]["open"]) : tempOpen;  // äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹openå›¾æ ‡
			this.usefontStyle.snode.node.close = (tempClose == "") ? (ifont + " " + this.nodeIconArray[this.nodeIcon]["close"]) : tempClose; // äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹closeå›¾æ ‡
			this.usefontStyle.snode.leaf = (tempLeaf == "") ? (ifont + " " + this.leafIconArray[this.leafIcon]) : tempLeaf; // äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
		} else {
			var node = snode.node;
			var leaf = snode.leaf;
			if(typeof node === 'undefined') {
				this.usefontStyle.snode.node.open = (tempOpen == "") ? (ifont + " " + this.nodeIconArray[this.nodeIcon]["open"]) : tempOpen;  // äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹openå›¾æ ‡
				this.usefontStyle.snode.node.close = (tempClose == "") ? (ifont + " " + this.nodeIconArray[this.nodeIcon]["close"]) : tempClose; // äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹closeå›¾æ ‡
			} else {
				var open = node.open;
				var close = node.close;
				if(typeof open === 'undefined'){
					this.usefontStyle.snode.node.open = (tempOpen == "") ? (ifont + " " + this.nodeIconArray[this.nodeIcon]["open"]) : tempOpen;  // äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹openå›¾æ ‡
				} else {
					this.usefontStyle.snode.node.open = ifont + " " + open;
				}
				if(typeof close === 'undefined') {
					this.usefontStyle.snode.node.close = (tempClose == "") ? (ifont + " " + this.nodeIconArray[this.nodeIcon]["close"]) : tempClose; // äºŒçº§å›¾æ ‡ä¸­çš„nodeèŠ‚ç‚¹closeå›¾æ ‡
				} else {
					this.usefontStyle.snode.node.close = ifont + " " + close;
				}
			}
			if(typeof leaf === 'undefined') {
				this.usefontStyle.snode.leaf = (tempLeaf == "") ? (ifont + " " + this.leafIconArray[this.leafIcon]) : tempLeaf; // äºŒçº§å›¾æ ‡ä¸­çš„leafèŠ‚ç‚¹å›¾æ ‡
			} else {
				this.usefontStyle.snode.leaf = ifont + " " + leaf;
			}
		}
	};

	/**
	 * @Desc: èµ‹å€¼å¤é€‰æ¡†å›¾æ ‡çš„classå±žæ€§å˜é‡
	 * @Param: ifontï¼š å½“å‰çš„å›¾æ ‡classå‰ç¼€ï¼Œå¦‚ dtreefont
	 * @Param: checkboxï¼š å½“å‰çš„å›¾æ ‡classå®žé™…å›¾æ ‡ï¼Œå¦‚ dtree-icon-jia1
	 */
	DTree.prototype.useDefaultOrUserDefineCheckboxStyle = function(ifont, checkbox){
		var _this = this;
		var tempOn = this.usefontStyle.checkbox.on;
		var tempOut = this.usefontStyle.checkbox.out;
		var tempNoall = this.usefontStyle.checkbox.noall;

		if(typeof checkbox === 'undefined'){
			this.usefontStyle.checkbox.on = (tempOn == "") ? (ifont + " " + LI_DIV_CHECKBAR_ON) : tempOn;
			this.usefontStyle.checkbox.out = (tempOut == "") ? (ifont + " " + LI_DIV_CHECKBAR_OUT) : tempOut;
			this.usefontStyle.checkbox.noall = (tempNoall == "") ? (ifont + " " + LI_DIV_CHECKBAR_NOALL) : tempNoall;
		} else {
			var on = checkbox.on;
			var out = checkbox.out;
			var noall = checkbox.noall;
			if(typeof on === 'undefined') {
				this.usefontStyle.checkbox.on = (tempOn == "") ? (ifont + " " + LI_DIV_CHECKBAR_ON) : tempOn;
			} else {
				this.usefontStyle.checkbox.on = ifont + " " + on;
			}
			if(typeof out === 'undefined') {
				this.usefontStyle.checkbox.out = (tempOut == "") ? (ifont + " " + LI_DIV_CHECKBAR_OUT) : tempOut;
			} else {
				this.usefontStyle.checkbox.out = ifont + " " + out;
			}
			if(typeof noall === 'undefined') {
				this.usefontStyle.checkbox.noall = (tempNoall == "") ? (ifont + " " + LI_DIV_CHECKBAR_NOALL) : tempNoall;
			} else {
				this.usefontStyle.checkbox.noall = ifont + " " + noall;
			}
		}
	};

	/**
	 * @Desc: èµ‹å€¼èœå•æ å›¾æ ‡çš„classå±žæ€§å˜é‡
	 * @Param: ifontï¼š å½“å‰çš„å›¾æ ‡classå‰ç¼€ï¼Œå¦‚ dtreefont
	 * @Param: menubarï¼š å½“å‰çš„å›¾æ ‡classå®žé™…å›¾æ ‡ï¼Œå¦‚ dtree-icon-jia1
	 */
	DTree.prototype.useDefaultOrUserDefineMenubarStyle = function(ifont, menubar){
		var _this = this;
		var tempMovedown = this.usefontStyle.menubar.movedown;
		var tempMoveup = this.usefontStyle.menubar.moveup;
		var tempRefresh = this.usefontStyle.menubar.refresh;
		var tempCheckAll = this.usefontStyle.menubar.checkAll;
		var tempUncheckAll = this.usefontStyle.menubar.unCheckAll;
		var tempInvertAll = this.usefontStyle.menubar.invertAll;
		var tempRemove = this.usefontStyle.menubar.remove;
		var tempSearch = this.usefontStyle.menubar.search;

		if(typeof menubar === 'undefined'){
			this.usefontStyle.menubar.movedown = (tempMovedown == "") ? (ifont + " " + LI_DIV_MENUBAR_DOWN) : tempMovedown;
			this.usefontStyle.menubar.moveup = (tempMoveup == "") ? (ifont + " " + LI_DIV_MENUBAR_UP) : tempMoveup;
			this.usefontStyle.menubar.refresh = (tempRefresh == "") ? (ifont + " " + LI_DIV_MENUBAR_REFRESH) : tempRefresh;
			this.usefontStyle.menubar.checkAll = (tempCheckAll == "") ? (ifont + " " + LI_DIV_MENUBAR_CHECKALL) : tempCheckAll;
			this.usefontStyle.menubar.unCheckAll = (tempUncheckAll == "") ? (ifont + " " + LI_DIV_MENUBAR_UNCHECKALL) : tempUncheckAll;
			this.usefontStyle.menubar.invertAll = (tempInvertAll == "") ? (ifont + " " + LI_DIV_MENUBAR_INVERTALL) : tempInvertAll;
			this.usefontStyle.menubar.remove = (tempRemove == "") ? (ifont + " " + LI_DIV_MENUBAR_DELETE) : tempRemove;
			this.usefontStyle.menubar.search = (tempSearch == "") ? (ifont + " " + LI_DIV_MENUBAR_SEARCH) : tempSearch;
		} else {
			var movedown = menubar.movedown;
			var moveup = menubar.moveup;
			var refresh = menubar.refresh;
			var checkAll = menubar.checkAll;
			var unCheckAll = menubar.unCheckAll;
			var invertAll = menubar.invertAll;
			var remove = menubar.remove;
			var search = menubar.search;
			if(typeof movedown === 'undefined') {
				this.usefontStyle.menubar.movedown = (tempMovedown == "") ? (ifont + " " + LI_DIV_MENUBAR_DOWN) : tempMovedown;
			} else {
				this.usefontStyle.menubar.movedown = ifont + " " + movedown;
			}
			if(typeof moveup === 'undefined') {
				this.usefontStyle.menubar.moveup = (tempMoveup == "") ? (ifont + " " + LI_DIV_MENUBAR_UP) : tempMoveup;
			} else {
				this.usefontStyle.menubar.moveup = ifont + " " + moveup;
			}
			if(typeof refresh === 'undefined') {
				this.usefontStyle.menubar.refresh = (tempRefresh == "") ? (ifont + " " + LI_DIV_MENUBAR_REFRESH) : tempRefresh;
			} else {
				this.usefontStyle.menubar.refresh = ifont + " " + refresh;
			}
			if(typeof checkAll === 'undefined') {
				this.usefontStyle.menubar.checkAll = (tempCheckAll == "") ? (ifont + " " + LI_DIV_MENUBAR_CHECKALL) : tempCheckAll;
			} else {
				this.usefontStyle.menubar.checkAll = ifont + " " + checkAll;
			}
			if(typeof unCheckAll === 'undefined') {
				this.usefontStyle.menubar.unCheckAll = (tempUncheckAll == "") ? (ifont + " " + LI_DIV_MENUBAR_UNCHECKALL) : tempUncheckAll;
			} else {
				this.usefontStyle.menubar.unCheckAll = ifont + " " + unCheckAll;
			}
			if(typeof invertAll === 'undefined') {
				this.usefontStyle.menubar.invertAll = (tempInvertAll == "") ? (ifont + " " + LI_DIV_MENUBAR_INVERTALL) : tempInvertAll;
			} else {
				this.usefontStyle.menubar.invertAll = ifont + " " + invertAll;
			}
			if(typeof remove === 'undefined') {
				this.usefontStyle.menubar.remove = (tempRemove == "") ? (ifont + " " + LI_DIV_MENUBAR_DELETE) : tempRemove;
			} else {
				this.usefontStyle.menubar.remove = ifont + " " + remove;
			}
			if(typeof search === 'undefined') {
				this.usefontStyle.menubar.search = (tempSearch == "") ? (ifont + " " + LI_DIV_MENUBAR_SEARCH) : tempSearch;
			} else {
				this.usefontStyle.menubar.search = ifont + " " + search;
			}
		}
	};

	/**
	 * @Desc: èµ‹å€¼æ‰©å±•èœå•æ å›¾æ ‡çš„classå±žæ€§å˜é‡
	 * @Param: ifontï¼š å½“å‰çš„å›¾æ ‡classå‰ç¼€ï¼Œå¦‚ dtreefont
	 * @Param: menubarExtï¼š å½“å‰çš„å›¾æ ‡classå®žé™…å›¾æ ‡ï¼Œå¦‚ dtree-icon-jia1
	 */
	DTree.prototype.useDefaultOrUserDefineMenubarExtStyle = function(ifont, menubarExt){
		var _this = this;
		var tempExt = this.usefontStyle.menubarExt;

		if(typeof menubarExt === 'undefined'){
			this.usefontStyle.menubarExt = (tempExt == "") ? ifont : tempExt;
		} else {
			this.usefontStyle.menubarExt = menubarExt;
		}
	};

	/**
	 * @Desc: èµ‹å€¼å·¥å…·æ å›¾æ ‡çš„classå±žæ€§å˜é‡
	 * @Param: ifontï¼š å½“å‰çš„å›¾æ ‡classå‰ç¼€ï¼Œå¦‚ dtreefont
	 * @Param: toolbarï¼š å½“å‰çš„å›¾æ ‡classå®žé™…å›¾æ ‡ï¼Œå¦‚ dtree-icon-jia1
	 */
	DTree.prototype.useDefaultOrUserDefineToolbarStyle = function(ifont, toolbar){
		var _this = this;
		var tempMovedown = this.usefontStyle.toolbar.menubar.movedown;
		var tempMoveup = this.usefontStyle.toolbar.menubar.moveup;
		var tempRefresh = this.usefontStyle.toolbar.menubar.refresh;
		var tempCheckAll = this.usefontStyle.toolbar.menubar.checkAll;
		var tempUnCheckAll = this.usefontStyle.toolbar.menubar.unCheckAll;
		var tempInvertAll = this.usefontStyle.toolbar.menubar.invertAll;
		var tempRemove = this.usefontStyle.toolbar.menubar.remove;
		var tempSearch = this.usefontStyle.toolbar.menubar.search;
		var tempExt = this.usefontStyle.toolbar.menubarExt;
		var tempPulldown = this.usefontStyle.toolbar.pulldown;
		var tempPullup = this.usefontStyle.toolbar.pullup;
		var tempAdd = this.usefontStyle.toolbar.add;
		var tempEdit = this.usefontStyle.toolbar.edit;
		var tempDel = this.usefontStyle.toolbar.del;


		if(typeof toolbar === 'undefined'){
			this.usefontStyle.toolbar.menubar.movedown = (tempMovedown == "") ? (ifont + " " + this.usefontStyle.menubar.movedown) : tempMovedown;
			this.usefontStyle.toolbar.menubar.moveup = (tempMoveup == "") ? (ifont + " " + this.usefontStyle.menubar.moveup) : tempMoveup;
			this.usefontStyle.toolbar.menubar.refresh = (tempRefresh == "") ? (ifont + " " + this.usefontStyle.menubar.refresh) : tempRefresh;
			this.usefontStyle.toolbar.menubar.checkAll = (tempCheckAll == "") ? (ifont + " " + this.usefontStyle.menubar.checkAll) : tempCheckAll;
			this.usefontStyle.toolbar.menubar.unCheckAll = (tempUnCheckAll == "") ? (ifont + " " + this.usefontStyle.menubar.unCheckAll) : tempUnCheckAll;
			this.usefontStyle.toolbar.menubar.invertAll = (tempInvertAll == "") ? (ifont + " " + this.usefontStyle.menubar.invertAll) : tempInvertAll;
			this.usefontStyle.toolbar.menubar.remove = (tempRemove == "") ? (ifont + " " + this.usefontStyle.menubar.remove) : tempRemove;
			this.usefontStyle.toolbar.menubar.search = (tempSearch == "") ? (ifont + " " + this.usefontStyle.menubar.search) : tempSearch;
			this.usefontStyle.toolbar.menubarExt = (tempExt == "") ? this.usefontStyle.menubarExt : tempExt;
			this.usefontStyle.toolbar.pulldown = (tempPulldown == "") ? (ifont + " " + LI_DIV_TOOLBAR_PULLDOWN) : tempPulldown;
			this.usefontStyle.toolbar.pullup = (tempPullup == "") ? (ifont + " " + LI_DIV_TOOLBAR_PULLUP) : tempPullup;
			this.usefontStyle.toolbar.add = (tempAdd == "") ? (ifont + " " + LI_DIV_TOOLBAR_ADD) : tempAdd;
			this.usefontStyle.toolbar.edit = (tempEdit == "") ? (ifont + " " + LI_DIV_TOOLBAR_EDIT) : tempEdit;
			this.usefontStyle.toolbar.del = (tempDel == "") ? (ifont + " " + LI_DIV_TOOLBAR_DEL) : tempDel;
		} else {
			var menubar = toolbar.menubar;
			var menubarExt = toolbar.menubarExt;
			var pulldown = toolbar.pulldown;
			var pullup = toolbar.pullup;
			var add = toolbar.add;
			var edit = toolbar.edit;
			var del = toolbar.del;

			if(typeof menubar === 'undefined'){
				this.usefontStyle.toolbar.menubar.movedown = (tempMovedown == "") ? (ifont + " " + this.usefontStyle.menubar.movedown) : tempMovedown;
				this.usefontStyle.toolbar.menubar.moveup = (tempMoveup == "") ? (ifont + " " + this.usefontStyle.menubar.moveup) : tempMoveup;
				this.usefontStyle.toolbar.menubar.refresh = (tempRefresh == "") ? (ifont + " " + this.usefontStyle.menubar.refresh) : tempRefresh;
				this.usefontStyle.toolbar.menubar.checkAll = (tempCheckAll == "") ? (ifont + " " + this.usefontStyle.menubar.checkAll) : tempCheckAll;
				this.usefontStyle.toolbar.menubar.unCheckAll = (tempUncheckAll == "") ? (ifont + " " + this.usefontStyle.menubar.unCheckAll) : tempUncheckAll;
				this.usefontStyle.toolbar.menubar.invertAll = (tempInvertAll == "") ? (ifont + " " + this.usefontStyle.menubar.invertAll) : tempInvertAll;
				this.usefontStyle.toolbar.menubar.remove = (tempRemove == "") ? (ifont + " " + this.usefontStyle.menubar.remove) : tempRemove;
				this.usefontStyle.toolbar.menubar.search = (tempSearch == "") ? (ifont + " " + this.usefontStyle.menubar.search) : tempSearch;
			} else {
				var movedown = menubar.movedown;
				var moveup = menubar.moveup;
				var refresh = menubar.refresh;
				var checkAll = menubar.checkAll;
				var unCheckAll = menubar.unCheckAll;
				var invertAll = menubar.invertAll;
				var remove = menubar.remove;
				var search = menubar.search;
				if(typeof movedown === 'undefined') {
					this.usefontStyle.toolbar.menubar.movedown = (tempMovedown == "") ? (ifont + " " + this.usefontStyle.menubar.movedown) : tempMovedown;
				} else {
					this.usefontStyle.toolbar.menubar.movedown = ifont + " " + movedown;
				}
				if(typeof moveup === 'undefined') {
					this.usefontStyle.toolbar.menubar.moveup = (tempMoveup == "") ? (ifont + " " + this.usefontStyle.menubar.moveup) : tempMoveup;
				} else {
					this.usefontStyle.toolbar.menubar.moveup = ifont + " " + moveup;
				}
				if(typeof refresh === 'undefined') {
					this.usefontStyle.toolbar.menubar.refresh = (tempRefresh == "") ? (ifont + " " + this.usefontStyle.menubar.refresh) : tempRefresh;
				} else {
					this.usefontStyle.toolbar.menubar.refresh = ifont + " " + refresh;
				}
				if(typeof checkAll === 'undefined') {
					this.usefontStyle.toolbar.menubar.checkAll = (tempCheckAll == "") ? (ifont + " " + this.usefontStyle.menubar.checkAll) : tempCheckAll;
				} else {
					this.usefontStyle.toolbar.menubar.checkAll = ifont + " " + checkAll;
				}
				if(typeof unCheckAll === 'undefined') {
					this.usefontStyle.toolbar.menubar.unCheckAll = (tempUncheckAll == "") ? (ifont + " " + this.usefontStyle.menubar.unCheckAll) : tempUncheckAll;
				} else {
					this.usefontStyle.toolbar.menubar.unCheckAll = ifont + " " + unCheckAll;
				}
				if(typeof invertAll === 'undefined') {
					this.usefontStyle.toolbar.menubar.invertAll = (tempInvertAll == "") ? (ifont + " " + this.usefontStyle.menubar.invertAll) : tempInvertAll;
				} else {
					this.usefontStyle.toolbar.menubar.invertAll = ifont + " " + invertAll;
				}
				if(typeof remove === 'undefined') {
					this.usefontStyle.toolbar.menubar.remove = (tempRemove == "") ? (ifont + " " + this.usefontStyle.menubar.remove) : tempRemove;
				} else {
					this.usefontStyle.toolbar.menubar.remove = ifont + " " + remove;
				}
				if(typeof search === 'undefined') {
					this.usefontStyle.toolbar.menubar.search = (tempSearch == "") ? (ifont + " " + this.usefontStyle.menubar.search) : tempSearch;
				} else {
					this.usefontStyle.toolbar.menubar.search = ifont + " " + search;
				}
			}

			if(typeof menubarExt === 'undefined'){
				this.usefontStyle.toolbar.menubarExt = (tempExt == "") ? this.usefontStyle.menubarExt : tempExt;
			} else {
				this.usefontStyle.toolbar.menubarExt = menubarExt;
			}

			if(typeof pulldown === 'undefined'){
				this.usefontStyle.toolbar.pulldown = (tempPulldown == "") ? (ifont + " " + LI_DIV_TOOLBAR_PULLDOWN) : tempPulldown;
			} else {
				this.usefontStyle.toolbar.pulldown = ifont + " " + pulldown;
			}
			if(typeof pullup === 'undefined'){
				this.usefontStyle.toolbar.pullup = (tempPullup == "") ? (ifont + " " + LI_DIV_TOOLBAR_PULLUP) : tempPullup;
			} else {
				this.usefontStyle.toolbar.pullup = ifont + " " + pullup;
			}
			if(typeof add === 'undefined'){
				this.usefontStyle.toolbar.add = (tempAdd == "") ? (ifont + " " + LI_DIV_TOOLBAR_ADD) : tempAdd;
			} else {
				this.usefontStyle.toolbar.add = ifont + " " + add;
			}
			if(typeof edit === 'undefined'){
				this.usefontStyle.toolbar.edit = (tempEdit == "") ? (ifont + " " + LI_DIV_TOOLBAR_EDIT) : tempEdit;
			} else {
				this.usefontStyle.toolbar.edit = ifont + " " + edit;
			}
			if(typeof del === 'undefined'){
				this.usefontStyle.toolbar.del = (tempDel == "") ? (ifont + " " + LI_DIV_TOOLBAR_DEL) : tempDel;
			} else {
				this.usefontStyle.toolbar.del = ifont + " " + del;
			}
		}
	};

	/**
	 * @Desc: èµ‹å€¼æ‰©å±•å·¥å…·æ å›¾æ ‡çš„classå±žæ€§å˜é‡
	 * @Param: ifontï¼š å½“å‰çš„å›¾æ ‡classå‰ç¼€ï¼Œå¦‚ dtreefont
	 * @Param: toolbarExtï¼š å½“å‰çš„å›¾æ ‡classå®žé™…å›¾æ ‡ï¼Œå¦‚ dtree-icon-jia1
	 */
	DTree.prototype.useDefaultOrUserDefineToolbarExtStyle = function(ifont, toolbarExt){
		var _this = this;
		var tempExt = this.usefontStyle.toolbarExt;

		if(typeof toolbarExt === 'undefined'){
			this.usefontStyle.toolbarExt = (tempExt == "") ? ifont : tempExt;
		} else {
			this.usefontStyle.toolbarExt = toolbarExt;
		}
	};

	/**
	 * @Desc: è®¾ç½®å›¾æ ‡çš„å±•å¼€å…³é—­ï¼Œä»¥åŠå±•å¼€æ—¶/å…³é—­æ—¶æ˜¯æœ€åŽä¸€çº§å›¾æ ‡çš„å¤„ç†
	 * @Param: $i_fnodeï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºä¸€çº§å›¾æ ‡èŠ‚ç‚¹
	 * @Param: $i_snodeï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºäºŒçº§å›¾æ ‡èŠ‚ç‚¹
	 */
	DTree.prototype.operateIcon = function($i_fnode, $i_snode){
		var _this = this;
		var ficonClass = $i_fnode.attr("data-iconClass");
		var iconClass = $i_snode.attr("data-iconClass");
		return{
			open: function(){
				$i_fnode.attr("data-spread","open");
				$i_snode.attr("data-spread","open");
				if(!ficonClass) {
					$i_fnode.removeClass(_this.usefontStyle.fnode.node.close);
					$i_fnode.addClass(_this.usefontStyle.fnode.node.open);
				}
				if(!iconClass) {
					$i_snode.removeClass(_this.usefontStyle.snode.node.close);
					$i_snode.addClass(_this.usefontStyle.snode.node.open);
				}
			},
			close: function(){
				$i_fnode.attr("data-spread","close");
				$i_snode.attr("data-spread","close");
				if(!ficonClass) {
					$i_fnode.removeClass(_this.usefontStyle.fnode.node.open);
					$i_fnode.addClass(_this.usefontStyle.fnode.node.close);
				}
				if(!iconClass) {
					$i_snode.removeClass(_this.usefontStyle.snode.node.open);
					$i_snode.addClass(_this.usefontStyle.snode.node.close);
				}
			},
			openWithLeaf: function(){
				$i_fnode.attr("data-spread","open");
				$i_snode.attr("data-spread","open");
				if(!ficonClass) {
					$i_fnode.removeClass(_this.usefontStyle.fnode.leaf);
					$i_fnode.addClass(_this.usefontStyle.fnode.node.open);
				}
				if(!iconClass) {
					$i_snode.removeClass(_this.usefontStyle.snode.leaf);
					$i_snode.addClass(_this.usefontStyle.snode.node.open);
				}
			},
			closeWithLeaf: function(){
				$i_fnode.attr("data-spread","last");
				$i_snode.attr("data-spread","last");

				if(!ficonClass) {
					$i_fnode.removeClass(_this.usefontStyle.fnode.node.open);
					$i_fnode.removeClass(_this.usefontStyle.fnode.node.close);
					$i_fnode.addClass(_this.usefontStyle.fnode.leaf);
				}

				if(!iconClass) {
					$i_snode.removeClass(_this.usefontStyle.snode.node.open);
					$i_snode.removeClass(_this.usefontStyle.snode.node.close);
					$i_snode.addClass(_this.usefontStyle.snode.leaf);
				}
			}
		}
	};

	/**
	 * @Desc: æ˜¾ç¤ºæ ‘çº¿
	 * @Param: $lisï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºç»„æˆæ ‘çš„lièŠ‚ç‚¹é›†
	 */
	DTree.prototype.showLine = function($lis){
		var _this = this;
		if(_this.line){
			if($lis && $lis.length > 0) {
				$lis.each(function(){
					_this.showLineLi($(this));
				});
			} else {
				_this.obj.find("li[data-id]").each(function(){
					_this.showLineLi($(this));
				});
			}
		}
	}

	/**
	 * @Desc: çœŸæ­£æ˜¾ç¤ºæ ‘çº¿çš„æ–¹æ³•
	 * @Param: $liï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºç»„æˆæ ‘çš„lièŠ‚ç‚¹
	 */
	DTree.prototype.showLineLi = function($li){
		var _this = this;
		var $div = $li.children("div"),
			$nextLi = $li.next("li"),
			$ul = $li.parent("ul");
		if($ul[0].id == _this.obj[0].id) {
			// æ ¹èŠ‚ç‚¹ä¸‹çš„èŠ‚ç‚¹
			$li.removeClass(LI_NAV_LINE);
			$li.removeClass(LI_NAV_LAST_LINE);
			$li.addClass(LI_NAV_FIRST_LINE);
		} else {
			// éžæ ¹èŠ‚ç‚¹ä¸‹çš„èŠ‚ç‚¹
			var $pnextLi = $ul.parent("li").next("li");
			if($pnextLi.length == 0) {
				if($nextLi.length == 0){
					$li.removeClass(LI_NAV_LINE);
					$li.removeClass(LI_NAV_FIRST_LINE);
					$li.addClass(LI_NAV_LAST_LINE);
				} else {
					$li.removeClass(LI_NAV_FIRST_LINE);
					$li.removeClass(LI_NAV_LAST_LINE);
					$li.addClass(LI_NAV_LINE);
				}
			}else {
				var $pnextdiv = $pnextLi.children("div");
				if($nextLi.length == 0 && $div.children("cite").attr("data-leaf") == "leaf" && $pnextdiv.children("cite").attr("data-leaf") == "leaf") {
					$li.removeClass(LI_NAV_FIRST_LINE);
					$li.removeClass(LI_NAV_LINE);
					$li.addClass(LI_NAV_LAST_LINE);
				} else {
					$li.removeClass(LI_NAV_FIRST_LINE);
					$li.removeClass(LI_NAV_LAST_LINE);
					$li.addClass(LI_NAV_LINE);
				}
			}
		}
	}

	/******************** åˆå§‹åŒ–æ•°æ®åŒºåŸŸ ********************/
	/**
	 * @Desc: è®¾ç½®é«˜åº¦
	 */
	DTree.prototype.autoHeight = function(){
		var _this = this;
		var height = _this.height;
		if(height != "") {
			if(_this.elem == _this.scroll){
				_this.obj.parent().css("height", height + "px");
			} else {
				var $toolbarDiv = _this.obj.closest(_this.scroll);
				$toolbarDiv.css("height", height + "px");
			}
		}
	};

	/**
	 * @Desc:  é‡è½½æ ‘
	 * @Param: optionsï¼š dtreeçš„æ‰€æœ‰å±žæ€§çš„jsonå¯¹è±¡
	 */
	DTree.prototype.reload = function(options){
		var _this = this;
		_this.reloadSetting(options);
		_this.init();
	};

	/**
	 * @Desc:  åˆå§‹åŒ–åŠ è½½
	 */
	DTree.prototype.loadTreeInit = function(){
		var _this = this;
		var asyncLoad = _this.asyncLoad;
		// åˆå§‹åŒ–åŠ è½½
		_this.init(function(){
			// ajaxåŠ è½½ä¹‹åŽçš„å›žè°ƒ
			if(asyncLoad && asyncLoad.length > 0) {
				_this.obj.addClass(NAV_SHOW);

				// è¯´æ˜Žæ­¤æ—¶è¦å¼‚æ­¥åŠ è½½å­èŠ‚ç‚¹
				_this.loadChildTreeInit(asyncLoad, 0);
			}
		})
	}

	/**
	 * @Desc:  åˆå§‹åŒ–åŠ è½½å­èŠ‚ç‚¹
	 * @Param: asyncLoadï¼š éœ€å¼‚æ­¥åŠ è½½çš„å±‚çº§ï¼Œåœ¨åŸºç¡€å±žæ€§ä¸­é…ç½®
	 * @Param: iï¼š å·²ç»åŠ è½½åˆ°çš„å±‚çº§
	 */
	DTree.prototype.loadChildTreeInit = function(asyncLoad, i){
		var _this = this;
		if(i == asyncLoad.length) { // æ»¡è¶³æ¡ä»¶ï¼Œç»ˆæ­¢é€’å½’
			return ;
		}

		var $div = _this.getNode(asyncLoad[i]);

		if($div && $div.length > 0) {
			// è®¾ç½®èŠ‚ç‚¹çŠ¶æ€
			var $ul = $div.next("ul"),
				$i_fnode = _this.getNodeDom($div).fnode(),
				$i_snode = _this.getNodeDom($div).snode();

			$ul.addClass(NAV_SHOW);
			_this.accordionUL($ul);
			_this.operateIcon($i_fnode, $i_snode).open();
			// åŠ è½½å­èŠ‚ç‚¹
			_this.getChild($div, undefined, function(){
				// ç»§ç»­é€’å½’
				_this.loadChildTreeInit(asyncLoad, ++i);
			});
		}

	}

	/**
	 * @Desc:  åˆå§‹åŒ–æ ‘
	 * @Param: callbackï¼š å¼‚æ­¥åŠ è½½å®Œæˆä¹‹åŽçš„å›žè°ƒå‡½æ•°
	 */
	DTree.prototype.init = function(callback){
		var _this = this;
		if (typeof _this !== "object") {
			layer.msg("æ ‘ç»„ä»¶æœªæˆåŠŸåŠ è½½ï¼Œè¯·æ£€æŸ¥é…ç½®", {icon:5});
			return ;
		}

		// è®¾ç½®ç»„ä»¶é«˜åº¦
		_this.autoHeight();

		if(_this.data) {
			_this.dataLoadTree(true, _this.obj, _this.data);
		} else {
			_this.asyncLoadTree(true, _this.obj, callback);
		}
	};

	/**
	 * @Desc:  åŠ è½½å­èŠ‚ç‚¹
	 * @Param: $divï¼š JQueryå¯¹è±¡ï¼Œä»£è¡¨å½“å‰å­èŠ‚ç‚¹çš„çˆ¶èŠ‚ç‚¹div
	 * @Param: dataï¼š dataæ–¹å¼åŠ è½½çš„æ•°æ®
	 * @Param: callbackï¼š å­èŠ‚ç‚¹åŠ è½½å®Œæˆä¹‹åŽçš„å›žè°ƒå–Šå‡º
	 */
	DTree.prototype.getChild = function($div, data, callback) {
		var _this = this, $ul = $div.next("ul");

		_this.setNodeParam($div);

		if(typeof data !== 'undefined') {
			_this.dataLoadTree(false, $ul, data);
		} else {
			_this.asyncLoadTree(false, $ul, callback);
		}
	};

	/**
	 * @Desc:  ç”¨dataåŠ è½½æ ‘
	 * @Param: firstï¼š è¡¨ç¤ºæ˜¯å¦ç¬¬ä¸€æ¬¡åŠ è½½
	 * @Param: $ulï¼š JQueryå¯¹è±¡ï¼Œä»£è¡¨å½“å‰æ•°æ®åŠ è½½åˆ°çš„ulæ ‡ç­¾é‡Œ
	 * @Param: dataï¼š dataåŠ è½½çš„æ•°æ®
	 */
	DTree.prototype.dataLoadTree = function(first, $ul, data){
		var _this = this;

		if(typeof data.length === 'undefined'){
			layer.msg("æ•°æ®è§£æžå¼‚å¸¸ï¼Œdataæ•°æ®æ ¼å¼ä¸æ­£ç¡®", {icon:5});
			return ;
		}

		if(first && data.length == 0) {
			$ul.html(_this.getNoneDom().text());
			return ;
		}

		//å…ˆå°†ulä¸­çš„å…ƒç´ æ¸…ç©º
		$ul.html("");

		var index = _this.load ? layer.load(1) : "";

		setTimeout(function () {
			// åŠ è½½å®Œæ¯•åŽæ‰§è¡Œæ ‘è§£æžå‰çš„å›žè°ƒ
			var returnData = _this.success(data, $ul, first);
			if(returnData) {
				data = returnData;
			}

			var pid = (first == true) ? $ul.attr("data-id") : _this.node.nodeId;
			var level = (first == true) ? 1 : parseInt(_this.node.level)+1;

			// è§£æžæ ‘
			if (_this.dataFormat == 'list'){
				//1.æž„å»ºä¸€ä¸ªå­˜æ”¾èŠ‚ç‚¹çš„æ ‘ç»„
				var rootListData = _this.queryListTreeByPid(pid, data);
				_this.loadListTree(rootListData, _this.data, level);
			} else {
				_this.loadTree(data, level);
			}

			// æ˜¾ç¤ºæ ‘çº¿
			_this.showLine();

			// è¿™ç§æƒ…å†µä¸‹éœ€è¦ä¸€å¼€å§‹å°±å°†toolbaræ˜¾ç¤ºåœ¨é¡µé¢ä¸Š
			if(_this.toolbar && _this.toolbarWay != 'contextmenu') {
				_this.setToolbarDom().setToolbarPlace(_this.toolbarMenu);
			}

			// åˆ¤æ–­æ˜¯å¦å­˜åœ¨é”™è¯¯æ•°æ®ï¼Œå¹¶æ˜¯å¦æ‰“å°é”™è¯¯æ•°æ®
			_this.msgErrData();

			// è®¾ç½®ä¸‹æ‹‰æ ‘çš„åˆå§‹å€¼
			if(first && _this.select && _this.selectInitVal){
				if(_this.checkbar) { // å¤é€‰æ¡†æ¨¡å¼ä¸‹
					_this.chooseDataInit(_this.selectInitVal);
					_this.selectCheckboxVal(_this.selectInitVal);
				} else { // æ™®é€šæ¨¡å¼ä¸‹
					_this.dataInit(_this.selectInitVal);
					_this.selectVal(_this.selectInitVal);
				}
			}

			// ä¿å­˜æ ‘å‰¯æœ¬
			_this.bak = _this.obj.html();

			// åŠ è½½å®Œæ¯•åŽçš„å›žè°ƒ
			_this.done(_this.data, $ul, first);

			if(_this.load){layer.close(index);}
		}, 100);
	}

	/**
	 * @Desc:  å¼‚æ­¥åŠ è½½æ ‘
	 * @Param: firstï¼š è¡¨ç¤ºæ˜¯å¦ç¬¬ä¸€æ¬¡åŠ è½½
	 * @Param: $ulï¼š JQueryå¯¹è±¡ï¼Œä»£è¡¨å½“å‰æ•°æ®åŠ è½½åˆ°çš„ulæ ‡ç­¾é‡Œ
	 * @Param: callbackï¼š å¼‚æ­¥åŠ è½½å®Œæˆä¹‹åŽçš„å›žè°ƒå‡½æ•°
	 */
	DTree.prototype.asyncLoadTree = function(first, $ul, callback){
		var _this = this;

		if (!_this.url) {
			layer.msg("æ•°æ®è¯·æ±‚å¼‚å¸¸ï¼Œurlå‚æ•°æœªæŒ‡å®š", {icon:5});
			return ;
		}

		//å…ˆå°†ulä¸­çš„å…ƒç´ æ¸…ç©º
		$ul.html("");

		var index = "";

		AjaxHelper.request({
			async: _this.async,
			headers: _this.headers,
			type: _this.method,
			url: _this.url,
			dataType: _this.dataType,
			contentType: _this.contentType,
			withCredentials: _this.withCredentials,
			data: _this.getFilterRequestParam(_this.getRequestParam()),
			beforeSend: function(XMLHttpRequest, self){
				index = _this.load ? layer.load(1) : "";
				var returnFlag = _this.beforeSend(this, XMLHttpRequest, self);
				if(!returnFlag) {
					if(_this.load){layer.close(index);}
				}
				return returnFlag;
			},
			success: function(result) {
				if (typeof result === 'string') {
					result = $.parseJSON(result);
				}

				// åŠ è½½å®Œæ¯•åŽæ‰§è¡Œæ ‘è§£æžå‰çš„å›žè°ƒ
				var returnData = _this.success(result, $ul, first);
				if(returnData) {
					result = returnData;
				}

				var code = "";
				if (_this.dataStyle == 'layuiStyle'){
					code = result[_this.response.statusName];
				} else {
					code = result.status[_this.response.statusName];
				}

				if (code == _this.response.statusCode) {

					var d = result[_this.response.rootName];

					if(first && typeof d.length === 'undefined'){
						$ul.html(_this.getNoneDom().errText("æ•°æ®è§£æžå¼‚å¸¸ï¼Œurlå›žè°ƒåŽçš„æ•°æ®æ ¼å¼ä¸æ­£ç¡®"));
						//layer.msg("æ•°æ®è§£æžå¼‚å¸¸ï¼Œurlå›žè°ƒåŽçš„æ•°æ®æ ¼å¼ä¸æ­£ç¡®", {icon:5});
						return ;
					}

					if(first && d.length == 0) {
						$ul.html(_this.getNoneDom().text());
						return ;
					}

					//1.è¯†åˆ«æ ¹èŠ‚ç‚¹ulä¸­çš„data-idæ ‡ç­¾ï¼Œåˆ¤æ–­é¡¶çº§çˆ¶èŠ‚ç‚¹
					var pid = (first == true) ? $ul.attr("data-id") : _this.node.nodeId;
					var level = (first == true) ? 1 : parseInt(_this.node.level)+1;

					// ç¬¬ä¸€æ¬¡è§£æžæ ‘
					if (_this.dataFormat == 'list'){
						//1.æž„å»ºä¸€ä¸ªå­˜æ”¾èŠ‚ç‚¹çš„æ ‘ç»„
						var rootListData = _this.queryListTreeByPid(pid, d);
						if(first) {
							_this.loadListTree(rootListData, d, level);
						} else {
							_this.loadListTree(rootListData, d, level, $ul);
						}
					} else {
						if(first) {
							_this.loadTree(d, level);
						} else {
							_this.loadTree(d, level, $ul);
						}
					}

					// æ˜¾ç¤ºæ ‘çº¿
					_this.showLine();

					// è¿™ç§æƒ…å†µä¸‹éœ€è¦ä¸€å¼€å§‹å°±å°†toolbaræ˜¾ç¤ºåœ¨é¡µé¢ä¸Š
					if(_this.toolbar && _this.toolbarWay != 'contextmenu') {
						_this.setToolbarDom().setToolbarPlace(_this.toolbarMenu);
					}

					// åˆ¤æ–­æ˜¯å¦å­˜åœ¨é”™è¯¯æ•°æ®ï¼Œå¹¶æ˜¯å¦æ‰“å°é”™è¯¯æ•°æ®
					_this.msgErrData();

					if(!first) {
						$ul.addClass(NAV_SHOW);
					}

					// è®¾ç½®ä¸‹æ‹‰æ ‘çš„åˆå§‹å€¼
					if(first && _this.select && _this.selectInitVal){
						if(_this.checkbar) { // å¤é€‰æ¡†æ¨¡å¼ä¸‹
							_this.chooseDataInit(_this.selectInitVal);
							_this.selectCheckboxVal(_this.selectInitVal);
						} else { // æ™®é€šæ¨¡å¼ä¸‹
							_this.dataInit(_this.selectInitVal);
							_this.selectVal(_this.selectInitVal);
						}
					}

					// ä¿å­˜æ ‘å‰¯æœ¬
					_this.bak = _this.obj.html();

					// åŠ è½½å®Œæ¯•åŽçš„å›žè°ƒ
					_this.done(result, $ul, first);

					callback && callback();
				} else {
					// å¦‚æžœæ‰“å°ä¸å‡ºä»»ä½•ä¿¡æ¯è¯´æ˜Žæ˜¯åœ¨è¿™é‡Œï¼Œç”¨äº†é”™è¯¯çš„æ•°æ®æ ¼å¼ï¼Œ æˆ–è¿”å›žç ä¸æ­£ç¡®
					if (_this.dataStyle == 'layuiStyle'){
						_this.obj.html(_this.getNoneDom().errText(result[_this.response.message]));
						_this.error(null, code, result[_this.response.message]);
					} else {
						_this.obj.html(_this.getNoneDom().errText(result.status[_this.response.message]));
						_this.error(null, code, result.status[_this.response.message]);
					}
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){// å¼‚æ­¥åŠ è½½å¼‚å¸¸å›žè°ƒ
				_this.obj.html(_this.getNoneDom().errText(textStatus + ": " + errorThrown));
				_this.error(XMLHttpRequest, textStatus, errorThrown);
			},
			complete: function(XMLHttpRequest, textStatus){// å¼‚æ­¥åŠ è½½å®Œæˆå›žè°ƒ
				if(_this.load){layer.close(index);}
				_this.complete(XMLHttpRequest, textStatus);
			}
		});

	}

	/**
	 * @Desc:  åˆå§‹åŒ–æ¸²æŸ“æ ‘æˆ–è€…æ‹¼æŽ¥æ¸²æŸ“æ ‘ï¼Œlistæ¨¡å¼ä¸‹
	 * @Param: nowListDataï¼š è¡¨ç¤ºå½“å‰éœ€è¦è¢«æ¸²æŸ“çš„æ•°æ®
	 * @Param: listDataï¼š è¡¨ç¤ºå…¨éƒ¨æ•°æ®
	 * @Param: levelï¼š å½“å‰æ¸²æŸ“çš„å±‚çº§
	 * @Param: $ulï¼š JQueryå¯¹è±¡ï¼Œä»£è¡¨å½“å‰æ•°æ®åŠ è½½åˆ°çš„ulæ ‡ç­¾é‡Œ
	 */
	DTree.prototype.loadListTree = function(nowListData, listData, level, $ul){
		var _this = this;
		$ul = $ul || _this.getNodeDom().nowOrRootUl();	//å½“å‰é€‰ä¸­çš„èŠ‚ç‚¹æˆ–æ ¹èŠ‚ç‚¹
		if (nowListData.length > 0){
			for (var i = 0; i < nowListData.length; i++) {
				// 1.èŽ·å–å·²çŸ¥èŠ‚ç‚¹çš„å…¨éƒ¨æ•°æ®
				var data = nowListData[i];
				if(typeof data !== "object") continue;
				var parseData = _this.parseData(data);
				var childListData = _this.queryListTreeByPid(parseData.treeId(), listData); // æ ¹æ®å·²çŸ¥æ•°æ®çš„idåˆ¤æ–­è¯¥æ¡æ•°æ®æ˜¯å¦è¿˜æœ‰å­æ•°æ®

				// 3. é¡µé¢å…ƒç´ åŠ è½½æ•°æ®
				$ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(childListData.length), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item")));
				// 4.æœ‰å­æ•°æ®çš„å…ƒç´ åŠ è½½å­èŠ‚ç‚¹
				if(childListData.length > 0){
					var cLevel = parseInt(level)+1;
					_this.loadListTree(childListData, listData, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']"));
				}
			}
		}
	};

	/**
	 * @Desc:  æ ¹æ®çˆ¶IDæŸ¥æ‰¾listæ•°æ®ä¸­åŒ¹é…çš„å…ƒç´
	 * @Param: pidï¼š è¡¨ç¤ºçˆ¶ID
	 * @Param: listDataï¼š è¡¨ç¤ºå…¨éƒ¨æ•°æ®
	 */
	DTree.prototype.queryListTreeByPid = function(pid, listData){
		var _this = this;
		var rootListData = [];
		if (listData) {
			for (var i = 0; i < listData.length; i++) {
				var data = listData[i];
				if(typeof data !== "object") continue;
				if(pid == "null" || pid == null){
					if(data[_this.response.parentId] == null) { rootListData.push(data); }
				} else {
					if (data[_this.response.parentId] == pid){
						if (data[_this.response.treeId] == pid){
							_this.errData.push(data);
						} else {
							rootListData.push(data);
						}
					}
				}
			}
		}
		return rootListData;
	};

	/**
	 * @Desc:  åˆå§‹åŒ–æ¸²æŸ“æ ‘æˆ–è€…æ‹¼æŽ¥æ¸²æŸ“æ ‘ï¼Œå±‚çº§å…³ç³»æ¨¡å¼ä¸‹
	 * @Param: listDataï¼š è¡¨ç¤ºå…¨éƒ¨æ•°æ®
	 * @Param: levelï¼š å½“å‰æ¸²æŸ“çš„å±‚çº§
	 * @Param: $ulï¼š JQueryå¯¹è±¡ï¼Œä»£è¡¨å½“å‰æ•°æ®åŠ è½½åˆ°çš„ulæ ‡ç­¾é‡Œ
	 */
	DTree.prototype.loadTree = function(listData, level, $ul){
		var _this = this;
		if (listData) {
			$ul = $ul || _this.getNodeDom().nowOrRootUl();	//å½“å‰é€‰ä¸­çš„èŠ‚ç‚¹æˆ–æ ¹èŠ‚ç‚¹
			for (var i = 0; i < listData.length; i++) {	// éåŽ†è·ŸèŠ‚ç‚¹æˆ–è¿½åŠ çš„è·ŸèŠ‚ç‚¹
				var data = listData[i];
				if(typeof data !== "object") continue;
				if(data[_this.response.treeId] == data[_this.response.parentId]) { _this.errData.push(data); }
				var parseData = _this.parseData(data);
				var children = parseData.children();
				$ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(children.length), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item")));
				if (children.length != 0) {
					var cLevel = parseInt(level)+1;
					_this.loadTree(children, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']"));
				}
			}
		}
	};

	/**
	 * @Desc:  åˆ¤æ–­åœ¨æ•°æ®åŠ è½½æ—¶æ˜¯å¦å­˜åœ¨é”™è¯¯æ•°æ®ï¼Œå¹¶æ˜¯å¦æ‰“å°é”™è¯¯æ•°æ®
	 * @Param:
	 */
	DTree.prototype.msgErrData = function() {
		var _this = this;
		if(_this.errData.length > 0 && _this.errDataShow) {
			var title = "";
			for(var i=0; i<_this.errData.length; i++) {
				var edata = _this.errData[i];
				title += "æ•°æ®ï¼šã€"+edata[_this.response.title]+"ã€‘ä¸­èŠ‚ç‚¹idå’Œä¸Šçº§idå€¼ä¸€è‡´ï¼ \n";
			}
			layer.msg(title, {icon:2,time:5000});
		}
		// æ˜¾ç¤ºä¹‹åŽï¼Œå°†é”™è¯¯æ•°æ®åˆ¶ç©º
		_this.errData = [];
	};

	/**
	 * @Desc:   è§£æžå•ä¸ªæ•°æ®
	 * @Param: dataï¼š è¢«è§£æžçš„å•ä¸ªæ•°æ®å¯¹è±¡
	 */
	DTree.prototype.parseData = function(data) {
		var _this = this;

		return {
			treeId: function(){
				return data[_this.response.treeId];
			},
			parentId: function(){
				return data[_this.response.parentId];
			},
			fmtTitle: function(){
				if(typeof _this.formatter.title === 'function'){
					var ftitle = _this.formatter.title(data);
					var tt = data[_this.response.title];
					tt = (ftitle == "" || ftitle == undefined || ftitle == null) ? tt : ftitle;
					return tt || "";
				}
				return data[_this.response.title];
			},
			title: function(){
				return data[_this.response.title];
			},
			level: function(){
				return data[_this.response.level] || "";
			},
			ficonClass: function(){
				return data[_this.response.ficonClass] || "";
			},
			iconClass: function(){
				return data[_this.response.iconClass] || "";
			},
			last: function(len){
				return ((len == 0) ?
					((typeof (data[_this.response.last]) === "boolean") ? data[_this.response.last] : true) :
					((typeof (data[_this.response.last]) === "boolean") ? data[_this.response.last] : false));
			},
			spread: function(level){
				return ((level < _this.initLevel) ?
					((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : true) :
					((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : false));
			},
			disabled: function(){
				return (typeof (data[_this.response.disabled]) === "boolean") ? data[_this.response.disabled] : false;
			},
			hide: function(){
				return (typeof (data[_this.response.hide]) === "boolean") ? data[_this.response.hide] : false;
			},
			checkArr: function(){
				var checkArr = [];
				var checkArrData = data[_this.response.checkArr];
				if(typeof checkArrData === 'string'){
					if(checkArrData.indexOf("{") > -1 && checkArrData.indexOf("}") > -1){
						checkArrData = JSON.parse(checkArrData);
					} else {
						checkArrData = {"type":"0","checked":checkArrData};
					}
				}
				if((typeof checkArrData === 'object') && (checkArrData !== null)){
					if(typeof checkArrData.length === 'undefined'){
						checkArr.push(checkArrData);
					} else {
						checkArr = checkArrData;
					}
				}

				if(checkArr.length > 0 && checkArr.length > _this.checkArrLen){
					_this.checkArrLen = checkArr.length;		// èŽ·å–å¤é€‰æ¡†ä¸ªæ•°
				}
				return checkArr;

			},
			children: function(){
				return data[_this.response.childName] || [];
			},
			basicData: function(){
				return event.escape(JSON.stringify(data[_this.response.basicData])) || JSON.stringify({});
			},
			recordData: function(){
				var recordData = _this.record ? event.cloneObj(data, [_this.response.treeId,
					_this.response.parentId,
					_this.response.title,
					_this.response.iconClass,
					_this.response.childName,
					_this.response.last,
					_this.response.spread,
					_this.response.disabled,
					_this.response.hide,
					_this.response.checkArr,
					_this.response.checked,
					_this.response.type,
					_this.response.basicData]) : {};

				return event.escape(JSON.stringify(recordData));
			},
			data: function(){
				return data;
			}
		}

	};

	/**
	 * @Desc: æ— èŠ‚ç‚¹æ•°æ®ã€èŠ‚ç‚¹æ•°æ®å¼‚å¸¸æ—¶æ˜¾ç¤ºdom
	 */
	DTree.prototype.getNoneDom = function(){
		var _this = this,
			rootId = _this.obj[0].id,
			noneTitle = _this.none;

		return {
			text: function(){
				return "<div class='"+NONETITLE+"' dtree-id='"+rootId+"'>"+noneTitle+"</div>";
			},
			errText: function(errInfo){
				return "<div class='"+NONETITLE+"' dtree-id='"+rootId+"'>"+errInfo+"</div>";
			}
		}
	};

	/**
	 * @Desc: æ–°å¢žèŠ‚ç‚¹çš„domå€¼
	 * @Param: treeIdï¼š èŠ‚ç‚¹ID
	 * @Param: parentIdï¼š èŠ‚ç‚¹çˆ¶ID
	 * @Param: titleï¼š èŠ‚ç‚¹æ ‡é¢˜
	 * @Param: fmtTitleï¼š èŠ‚ç‚¹é™„åŠ æ ‡é¢˜
	 * @Param: lastï¼š æ˜¯å¦æœ€åŽä¸€çº§èŠ‚ç‚¹
	 * @Param: ficonClassï¼š ä¸€çº§å›¾æ ‡class
	 * @Param: iconClassï¼š äºŒçº§å›¾æ ‡class
	 * @Param: checkArrï¼š å¤é€‰æ¡†
	 * @Param: spreadï¼š æ˜¯å¦å±•å¼€
	 * @Param: disabledï¼š æ˜¯å¦ç¦ç”¨
	 * @Param: hideï¼š æ˜¯å¦éšè—
	 */
	DTree.prototype.getDom = function(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide) {
		var _this = this,
			rootId = _this.obj[0].id,
			toolbar = _this.toolbar,
			checkbar = _this.checkbar;

		return {
			fnode: function() {	// + - å›¾æ ‡
				// èŽ·å–å›¾æ ‡çš„å˜é‡
				var fnodeIcon = _this.fnodeIcon,
					fleafIcon = _this.fleafIcon;

				var fleafIconLeaf = _this.usefontStyle.fnode.leaf,
					fnodeIconOpen =  _this.usefontStyle.fnode.node.open,
					fnodeIconClose =  _this.usefontStyle.fnode.node.close;

				if(ficonClass){
					var iconfont = _this.iconfont;
					if(typeof iconfont === 'string') {
						fleafIconLeaf = iconfont + " " + ficonClass;
						fnodeIconOpen = iconfont + " " + ficonClass;
						fnodeIconClose = iconfont + " " + ficonClass;
					} else {
						fleafIconLeaf = iconfont[0] + " " + ficonClass;
						fnodeIconOpen = iconfont[0] + " " + ficonClass;
						fnodeIconClose = iconfont[0] + " " + ficonClass;
					}
				}

				if(fnodeIcon != "-1" && fleafIcon != "-1"){	// éƒ½åŠ è½½
					return last ? "<i class='"+fleafIconLeaf+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"'></i>" : "<i class='"+fnodeIconClose+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}

				if(fnodeIcon != "-1" && fleafIcon == "-1"){	// åŠ è½½node éšè—leaf
					return last ? "<i class='"+fleafIconLeaf+" "+ICON_HIDE+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"'></i>" : "<i class='"+fnodeIconClose+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}

				if(fnodeIcon == "-1" && fleafIcon != "-1"){	// éšè—node åŠ è½½leaf
					return last ? "<i class='"+fleafIconLeaf+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"'></i>" : "<i class='"+fnodeIconClose+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}

				if(fnodeIcon == "-1" && fleafIcon == "-1"){	// éƒ½éšè—
					return last ? "<i class='"+fleafIconLeaf+" "+ICON_HIDE+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' style='display:none;'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"'></i>" : "<i class='"+fnodeIconClose+" "+_this.style.dfont+" "+_this.style.ficon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}
			},
			node: function() {	// äºŒçº§å›¾æ ‡æ ·å¼
				// èŽ·å–å›¾æ ‡çš„å˜é‡
				var nodeIcon = _this.nodeIcon,
					leafIcon = _this.leafIcon;

				var sleafIconLeaf = _this.usefontStyle.snode.leaf,
					snodeIconOpen =  _this.usefontStyle.snode.node.open,
					snodeIconClose =  _this.usefontStyle.snode.node.close;
				if(iconClass){
					var iconfont = _this.iconfont;
					if(typeof iconfont === 'string') {
						sleafIconLeaf = iconfont + " " + iconClass;
						snodeIconOpen = iconfont + " " + iconClass;
						snodeIconClose = iconfont + " " + iconClass;
					} else {
						sleafIconLeaf = iconfont[0] + " " + iconClass;
						snodeIconOpen = iconfont[0] + " " + iconClass;
						snodeIconClose = iconfont[0] + " " + iconClass;
					}
				}

				if(nodeIcon != "-1" && leafIcon != "-1"){	// éƒ½åŠ è½½
					return last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}

				if(nodeIcon != "-1" && leafIcon == "-1"){	// åŠ è½½node éšè—leaf
					return last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}

				if(nodeIcon == "-1" && leafIcon != "-1"){	// éšè—node åŠ è½½leaf
					return last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}

				if(nodeIcon == "-1" && leafIcon == "-1"){	// éƒ½éšè—
					return last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}
			},
			checkbox: function() {	// å¤é€‰æ¡†
				var flag = false;
				if(_this.checkbarLoad == "node"){if (checkbar) {flag = true;}} else {if (last) {if (checkbar) {flag = true;}}}

				if(flag){
					var result = "<div class='"+LI_DIV_CHECKBAR+"' data-id='"+treeId+"' dtree-id='"+rootId+"'>";
					if(checkArr && checkArr.length > 0){

						for (var i = 0; i < checkArr.length; i++) {
							var checkData = checkArr[i];
							var checked = checkData[_this.response.checked];
							var type = checkData[_this.response.type];
							var CHOOSE_CLASS = _this.usefontStyle.checkbox.out;
							if (checked == "2") {	//åŠé€‰æ‹©
								CHOOSE_CLASS = _this.usefontStyle.checkbox.noall + " " + _this.style.chs;
							} else if (checked == "1") {	//é€‰æ‹©
								CHOOSE_CLASS = _this.usefontStyle.checkbox.on + " " + _this.style.chs;
							} else {	//æœªé€‰æ‹©æˆ–è€…æ— å€¼
								CHOOSE_CLASS = _this.usefontStyle.checkbox.out;
							}
							var disClass = "";
							if(disabled){disClass = NAV_DIS;}
							result += "<i class='"+CHOOSE_CLASS+" "+_this.style.dfont+" "+_this.style.cbox+" "+disClass+"' data-id='"+treeId+"' dtree-id='"+rootId+"' data-checked='"+checked+"' data-initchecked='"+checked+"' data-type='"+type+"' dtree-click='"+eventName.checkNodeClick+"' data-par='."+LI_CLICK_CHECKBAR+"' dtree-disabled='"+disabled+"'></i>";
						}
					}
					result += "</div>";
					return result;
				}

				return "";
			},
			text: function() {	// æ–‡å­—æ˜¾ç¤º
				var disClass = "";
				if(disabled){disClass = NAV_DIS;}
				return "<cite class='"+LI_DIV_TEXT_CLASS+" "+disClass+"' data-id='"+treeId+"' data-leaf='"+(last ? "leaf" : "node")+"' dtree-disabled='"+disabled+"' data-title='"+title+"' >"+fmtTitle+"</cite>";
			},
			ul: function() {	//å­èŠ‚ç‚¹ul
				return last ? "<ul class='"+LI_NAV_CHILD+"' data-id='"+treeId+"' dtree-id='"+rootId+"'></ul>" :
					(spread ? "<ul class='"+LI_NAV_CHILD+" "+NAV_SHOW+"' data-id='"+treeId+"' dtree-id='"+rootId+"'></ul>" : "<ul class='"+LI_NAV_CHILD+"' data-id='"+treeId+"' dtree-id='"+rootId+"'></ul>");
			}
		};
	};

	/**
	 * @Desc: æ›¿æ¢èŠ‚ç‚¹çš„domå€¼ï¼Œæˆ–æŒ‡å®šè¿™äº›å€¼
	 * @Param: $divï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰è¢«æ“ä½œçš„èŠ‚ç‚¹
	 * @Param: treeIdï¼š èŠ‚ç‚¹ID
	 * @Param: lastï¼š æ˜¯å¦æœ€åŽä¸€çº§èŠ‚ç‚¹
	 * @Param: spreadï¼š æ˜¯å¦å±•å¼€
	 * @Param: disabledï¼š æ˜¯å¦ç¦ç”¨
	 * @Param: hideï¼š æ˜¯å¦éšè—
	 */
	DTree.prototype.replaceDom = function($div, treeId, last, spread, disabled, hide) {
		var _this = this,
			rootId = _this.obj[0].id,
			toolbar = _this.toolbar,
			checkbar = _this.checkbar;

		return {
			fnode: function(ficonClass) {	// + - å›¾æ ‡
				var fnode = "";

				// èŽ·å–å›¾æ ‡çš„å˜é‡
				var fnodeIcon = _this.fnodeIcon,
					fleafIcon = _this.fleafIcon;

				var fleafIconLeaf = _this.usefontStyle.fnode.leaf,
					fnodeIconOpen =  _this.usefontStyle.fnode.node.open,
					fnodeIconClose =  _this.usefontStyle.fnode.node.close;

				if(ficonClass){
					var iconfont = _this.iconfont;
					if(typeof iconfont === 'string') {
						fleafIconLeaf = iconfont + " " + ficonClass;
						fnodeIconOpen = iconfont + " " + ficonClass;
						fnodeIconClose = iconfont + " " + ficonClass;
					} else {
						fleafIconLeaf = iconfont[0] + " " + ficonClass;
						fnodeIconOpen = iconfont[0] + " " + ficonClass;
						fnodeIconClose = iconfont[0] + " " + ficonClass;
					}
				}

				if(fnodeIcon != "-1" && leafIcon != "-1"){	// éƒ½åŠ è½½
					fnode = last ? "<i class='"+fleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+fnodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}else if(nodeIcon != "-1" && leafIcon == "-1"){	// åŠ è½½node éšè—leaf
					fnode = last ? "<i class='"+fleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+fnodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}else if(nodeIcon == "-1" && leafIcon != "-1"){	// éšè—node åŠ è½½leaf
					fnode = last ? "<i class='"+fleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+fnodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}else if(nodeIcon == "-1" && leafIcon == "-1"){	// éƒ½éšè—
					fnode = last ? "<i class='"+fleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+fnodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+fnodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+ficonClass+"'></i>");
				}
				if(fnode != ""){_this.getNodeDom($div).fnode().replaceWith($(fnode));}
			},
			node: function(iconClass) {	// äºŒçº§å›¾æ ‡æ ·å¼
				var snode = "";

				// èŽ·å–å›¾æ ‡çš„å˜é‡
				var nodeIcon = _this.nodeIcon,
					leafIcon = _this.leafIcon;

				var sleafIconLeaf = _this.usefontStyle.snode.leaf,
					snodeIconOpen =  _this.usefontStyle.snode.node.open,
					snodeIconClose =  _this.usefontStyle.snode.node.close;
				if(iconClass){
					var iconfont = _this.iconfont;
					if(typeof iconfont === 'string') {
						sleafIconLeaf = iconfont + " " + iconClass;
						snodeIconOpen = iconfont + " " + iconClass;
						snodeIconClose = iconfont + " " + iconClass;
					} else {
						sleafIconLeaf = iconfont[0] + " " + iconClass;
						snodeIconOpen = iconfont[0] + " " + iconClass;
						snodeIconClose = iconfont[0] + " " + iconClass;
					}
				}

				if(nodeIcon != "-1" && leafIcon != "-1"){	// éƒ½åŠ è½½
					snode = last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}else if(nodeIcon != "-1" && leafIcon == "-1"){	// åŠ è½½node éšè—leaf
					snode = last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}else if(nodeIcon == "-1" && leafIcon != "-1"){	// éšè—node åŠ è½½leaf
					snode = last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}else if(nodeIcon == "-1" && leafIcon == "-1"){	// éƒ½éšè—
					snode = last ? "<i class='"+sleafIconLeaf+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='last' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" :
						(spread ? "<i class='"+snodeIconOpen+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='open' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>" : "<i class='"+snodeIconClose+" "+DTREEFONTSPECIAL+" "+_this.style.dfont+" "+_this.style.icon+"' data-spread='close' data-id='"+treeId+"' dtree-id='"+rootId+"' data-iconClass='"+iconClass+"'></i>");
				}
				if(snode != ""){_this.getNodeDom($div).snode().replaceWith($(snode));}
			},
			checkbox: function(checkArr) {	// å¤é€‰æ¡†
				var flag = false;
				if(_this.checkbarLoad == "node"){if (checkbar) {flag = true;}} else {if (last) {if (checkbar) {flag = true;}}}

				if(flag){
					var result = "<div class='"+LI_DIV_CHECKBAR+"' data-id='"+treeId+"' dtree-id='"+rootId+"'>";
					if(checkArr && checkArr.length > 0){

						for (var i = 0; i < checkArr.length; i++) {
							var checkData = checkArr[i];
							var checked = checkData[_this.response.checked];
							var type = checkData[_this.response.type];
							var CHOOSE_CLASS = _this.usefontStyle.checkbox.out;
							if (checked == "2") {	//åŠé€‰æ‹©
								CHOOSE_CLASS = _this.usefontStyle.checkbox.noall + " " + _this.style.chs;
							} else if (checked == "1") {	//é€‰æ‹©
								CHOOSE_CLASS = _this.usefontStyle.checkbox.on + " " + _this.style.chs;
							} else {	//æœªé€‰æ‹©æˆ–è€…æ— å€¼
								CHOOSE_CLASS = _this.usefontStyle.checkbox.out;
							}
							var disClass = "";
							if(disabled){disClass = NAV_DIS;}
							result += "<i class='"+CHOOSE_CLASS+" "+_this.style.dfont+" "+_this.style.cbox+" "+disClass+"' data-id='"+treeId+"' dtree-id='"+rootId+"' data-checked='"+checked+"' data-initchecked='"+checked+"' data-type='"+type+"' dtree-click='"+eventName.checkNodeClick+"' data-par='."+LI_CLICK_CHECKBAR+"' dtree-disabled='"+disabled+"'></i>";
						}
					}
					result += "</div>";
					_this.getNodeDom($div).snode().next("div").replaceWith($(result));
				}
			},
			text: function(title,fmtTitle) {	// æ–‡å­—æ˜¾ç¤º
				var disClass = "";
				if(disabled){disClass = NAV_DIS;}
				var cite = "<cite class='"+LI_DIV_TEXT_CLASS+" "+disClass+"' data-title='"+title+"' data-id='"+treeId+"' data-leaf='"+(last ? "leaf" : "node")+"' dtree-disabled='"+disabled+"' >"+fmtTitle || title+"</cite>"
				_this.getNodeDom($div).cite().replaceWith($(cite));
			},
			ul: function() {	//å­èŠ‚ç‚¹ul
				var ul = last ? "<ul class='"+LI_NAV_CHILD+"' data-id='"+treeId+"' dtree-id='"+rootId+"'></ul>" :
					(spread ? "<ul class='"+LI_NAV_CHILD+" "+NAV_SHOW+"' data-id='"+treeId+"' dtree-id='"+rootId+"'></ul>" : "<ul class='"+LI_NAV_CHILD+"' data-id='"+treeId+"' dtree-id='"+rootId+"'></ul>");
				_this.getNodeDom($div).nextUl().replaceWith($(ul));
			},
			div: function(){
				$div.attr("data-id", treeId);
			},
			basicData: function(basicData){
				basicData = (basicData == "{}") ? "" : basicData;
				$div.attr("data-basic", basicData);
			},
			recordData: function(recordData){
				recordData = (recordData == "{}") ? "" : recordData;
				$div.attr("data-record", recordData);
			},
			p_li: function(pId){
				var $li = $div.parent("li");
				$li.attr("data-id", treeId);
				if(pId) {
					$li.attr("data-pid", pId);
				}
				return $li;
			}
		};

	};

	/**
	 * @Desc: èŽ·å–æ‹¼æŽ¥å¥½çš„liçš„dom
	 * @Param: treeIdï¼š èŠ‚ç‚¹ID
	 * @Param: parentIdï¼š èŠ‚ç‚¹çˆ¶ID
	 * @Param: titleï¼š èŠ‚ç‚¹æ ‡é¢˜
	 * @Param: fmtTitleï¼š èŠ‚ç‚¹é™„åŠ æ ‡é¢˜
	 * @Param: lastï¼š æ˜¯å¦æœ€åŽä¸€çº§èŠ‚ç‚¹
	 * @Param: ficonClassï¼š ä¸€çº§å›¾æ ‡class
	 * @Param: iconClassï¼š äºŒçº§å›¾æ ‡class
	 * @Param: checkArrï¼š å¤é€‰æ¡†
	 * @Param: levelï¼š å½“å‰liçš„å±‚çº§
	 * @Param: spreadï¼š æ˜¯å¦å±•å¼€
	 * @Param: disabledï¼š æ˜¯å¦ç¦ç”¨
	 * @Param: hideï¼š æ˜¯å¦éšè—
	 * @Param: basicDataï¼š è‡ªå®šä¹‰çš„æ‰©å±•å­—æ®µå€¼ï¼ˆè½¬ä¹‰åŽçš„JSONå­—ç¬¦ï¼‰
	 * @Param: recordDataï¼š å¼€å¯è®°å½•æ¨¡å¼çš„è®°å½•å€¼ï¼ˆè½¬ä¹‰åŽçš„JSONå­—ç¬¦ï¼‰
	 * @Param: isRootï¼š å½“å‰èŠ‚ç‚¹æ˜¯å¦æ˜¯æ ¹èŠ‚ç‚¹ä¸‹çš„èŠ‚ç‚¹
	 */
	DTree.prototype.getLiItemDom =  function(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide, basicData, recordData, isRoot) {
		var _this = this,
			rootId = _this.obj[0].id;

		var dom = _this.getDom(treeId, parentId, title, fmtTitle, last, ficonClass, iconClass, checkArr, level, spread, disabled, hide);
		basicData = (basicData == "{}") ? "" : basicData;
		recordData = (recordData == "{}") ? "" : recordData;
		var div = "<div class='"+LI_DIV_ITEM+" "+_this.style.item+"' data-id='"+treeId+"' dtree-id='"+rootId+"' dtree-click='"+eventName.itemNodeClick+"' data-basic='"+basicData+"' data-record='"+recordData+"' dtree-disabled='"+disabled+"' dtree-hide='"+hide+"' ";
		if(_this.toolbar){
			if(_this.toolbarWay == "contextmenu") {
				if(_this.toolbarLoad == "node") { div += " d-contextmenu='true'>"; }
				if(_this.toolbarLoad == "noleaf") { if(!last){ div += " d-contextmenu='true'>"; } else { div += " d-contextmenu='false'>";} }
				if(_this.toolbarLoad == "leaf") { if(last){ div += " d-contextmenu='true'>"; } else { div += " d-contextmenu='false'>";} }
			} else { div += " d-contextmenu='false'>"; }
		} else { div += " d-contextmenu='false'>"; }

		var hideClass = "";
		var lineClass = "";
		if(hide){hideClass = NAV_HIDE;}
		var li = ["<li " + "class='"+LI_CLICK_CHECKBAR+" "+LI_NAV_ITEM+" "+hideClass+" "+lineClass+"'" + "data-id='"+treeId+"'" + "data-pid='"+(isRoot == "root" ? ((typeof parentId !== undefined && parentId != "") ? parentId : "-1") : parentId)+"'" + "dtree-id='"+rootId+"'" + "data-index='"+level+"'" + "dtree-hide='"+hide+"'" +">" +
		div ,
			dom.fnode(),
			dom.node(),
			dom.checkbox(),
			dom.text(),
			"</div>", dom.ul(), "</li>"].join("");

		return li;
	};

	/**
	 * @Desc: åˆå§‹åŒ–èŠ‚ç‚¹ï¼Œç”¨äºŽæ•°æ®å›žæ˜¾
	 * @Param: chooseIdï¼š èŠ‚ç‚¹ID
	 */
	DTree.prototype.dataInit = function(chooseId){
		var _this = this;
		var $div = _this.obj.find("div[data-id='"+chooseId+"']");
		if($div && $div.length > 0) {
			_this.obj.find("."+NAV_THIS).removeClass(NAV_THIS);
			_this.obj.find("."+_this.style.itemThis).removeClass(_this.style.itemThis);
			$div.addClass(NAV_THIS);
			$div.addClass(_this.style.itemThis);
			_this.setNodeParam($div);
			// å°†è¯¥èŠ‚ç‚¹çš„çˆ¶èŠ‚ç‚¹å…¨éƒ¨å±•å¼€
			var $li_parents = $div.parents("."+LI_NAV_ITEM);
			$li_parents.children("ul").addClass(NAV_SHOW);
			$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).addClass(_this.usefontStyle.fnode.node.open);
			$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).removeClass(_this.usefontStyle.fnode.node.close);
			$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).addClass(_this.usefontStyle.snode.node.open);
			$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).removeClass(_this.usefontStyle.snode.node.close);
		}
		return _this.getNowParam();
	};

	/**
	 * @Desc: åŸºäºŽå¤‡ä»½çš„Htmlæ•°æ®å›žæ»š
	 * @Param: chooseIdï¼š èŠ‚ç‚¹ID
	 */
	DTree.prototype.rollbackHtml = function(chooseId){
		var _this = this;
		if(_this.bak) {
			_this.obj.html(_this.bak);
			// å–æ¶ˆå…¨éƒ¨é€‰ä¸­çŠ¶æ€
			_this.cancelNavThis();
			if(_this.checkbar) {
				_this.cancelCheckedNode();
				_this.chooseDataInit(chooseId);
			} else {
				_this.dataInit(chooseId);
			}

			_this.bak = _this.obj.html();
		}
	};


	/******************** åŸºç¡€äº‹ä»¶åŒºåŸŸ ********************/
	/**
	 * @Desc: æ•°æ®æ ¼å¼åŒ–
	 * @Param: htmlï¼š éœ€è¦æ ¼å¼åŒ–çš„æ•°æ®
	 */
	DTree.prototype.escape = function(html){
		return event.escape(html);
	};

	/**
	 * @Desc: æ ¼å¼åŒ–æ•°æ®è½¬å›žæ­£å¸¸æ•°æ®
	 * @Param: strï¼š éœ€è¦è½¬å›žçš„æ•°æ®
	 */
	DTree.prototype.unescape = function(str){
		return event.unescape(str);
	};

	/**
	 * @Desc: å–æ¶ˆé€‰ä¸­å½“å‰é€‰ä¸­çš„div
	 */
	DTree.prototype.cancelNavThis = function(){
		var _this = this;
		_this.obj.find("div[data-id]").parent().find("."+NAV_THIS).removeClass(NAV_THIS);
		_this.obj.find("div[data-id]").parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis);
	}

	/**
	 * @Desc: é€‰ä¸­div
	 * @Param: idï¼š å½“å‰divæœ¬èº« / å½“å‰é€‰ä¸­divçš„idå€¼
	 */
	DTree.prototype.navThis = function(id){
		var _this = this;
		var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']");
		if($div != null) {
			_this.cancelNavThis();
			$div.addClass(NAV_THIS);
			$div.addClass(_this.style.itemThis);
		}
	}

	/**
	 * @Desc: æ‰‹é£Žç´æ¨¡å¼æ“ä½œå…¶ä»–èŠ‚ç‚¹
	 * @Param: $ulï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºdtreeä¸­çš„ulèŠ‚ç‚¹
	 */
	DTree.prototype.accordionUL = function($ul) {
		var _this = this;
		if(_this.accordion) {
			$ul.closest("li[data-index]").siblings("li[data-index]").children("ul[data-id]").removeClass(NAV_SHOW);
			var $divs = $ul.closest("li[data-index]").siblings("li[data-index]").children("ul[data-id]").prev("div");
			if($divs.length && $divs.length > 0) {
				for (var i=0; i<$divs.length; i++) {
					var $div = $($divs[i]);
					var $i_fnode = _this.getNodeDom($div).fnode(),
						$i_snode = _this.getNodeDom($div).snode();
					if($i_fnode.attr("data-spread") != 'last'){
						_this.operateIcon($i_fnode, $i_snode).close();
					}
				}
			}

		}
	};

	/**
	 * @Desc: å±•å¼€æˆ–éšè—èŠ‚ç‚¹  ä½œç”¨ç‚¹ï¼š div
	 * @Param: $divï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰æ“ä½œçš„divèŠ‚ç‚¹
	 */
	DTree.prototype.clickSpread = function($div) {
		var _this = this;
		var $i_fnode = _this.getNodeDom($div).fnode(),
			$i_snode = _this.getNodeDom($div).snode(),
			$cite = _this.getNodeDom($div).cite(),
			spread = $i_fnode.attr("data-spread"),
			$ul = $div.next("ul");

		if ($ul.length > 0) {
			if (spread == "close") {
				if (_this.type=="load") {	//å¢žåŠ åŠ è½½
					if (_this.cache) {	//å¼€å¯ç¼“å­˜
						if ($ul.html()) {
							$ul.addClass(NAV_SHOW);
							_this.accordionUL($ul);
						} else {	//åŠ è½½èŠ‚ç‚¹
							_this.getChild($div);
							_this.accordionUL($ul);
						}
					}else {	//æ¯æ¬¡å–æ–°çš„æ•°æ®
						$ul.html("");
						_this.getChild($div);
						_this.accordionUL($ul);
					}
				} else {	// å…¨é‡åŠ è½½
					$ul.addClass(NAV_SHOW);
					_this.accordionUL($ul);
				}
				_this.operateIcon($i_fnode, $i_snode).open();
			} else if (spread == "open") {
				$ul.removeClass(NAV_SHOW);
				_this.operateIcon($i_fnode, $i_snode).close();
			}
		}
	};

	/**
	 * @Desc: è®¾ç½®èŠ‚ç‚¹ä¸ºdisabled
	 * @Param: disabledIdsï¼š éœ€è¦è®¾ç½®ç¦ç”¨çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„
	 */
	DTree.prototype.setDisabledNodes = function(disabledIds){
		var _this = this;
		var disabledId = [];
		if(typeof disabledIds === "string") {
			disabledId = disabledIds.split(",");
		} else {
			disabledId = disabledIds;
		}

		if(disabledIds.length) {
			for (var i=0; i<disabledId.length; i++) {
				_this.setDisabledNode(_this.getNodeDom(disabledId[i]).div());
			}
		} else {
			_this.setDisabledNode(_this.getNodeDom(disabledId+"").div());
		}
	};

	/**
	 * @Desc: è®¾ç½®å…¨éƒ¨èŠ‚ç‚¹ä¸ºdisabled
	 * @Param: disabledIdsï¼š éœ€è¦è®¾ç½®ç¦ç”¨çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„
	 */
	DTree.prototype.setDisabledAllNodes = function(){
		var _this = this;
		_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"']").each(function(){
			var $div = $(this);
			_this.setDisabledNode($div);
		});
	};

	/**
	 * @Desc: è®¾ç½®èŠ‚ç‚¹ä¸ºdisabled
	 * @Param: $divï¼š JQueryå¯¹è±¡ï¼Œéœ€è¦è®¾ç½®ç¦ç”¨çš„èŠ‚ç‚¹
	 */
	DTree.prototype.setDisabledNode = function($div){
		var _this = this;
		var $i = $div.children("div."+LI_DIV_CHECKBAR).children("i[data-par]");
		var $cite = $div.children("cite[data-leaf]");
		if($div != null && $div.attr("dtree-disabled") != "true") {
			$div.attr("dtree-disabled", "true");
			$i.attr("dtree-disabled", "true");
			$i.addClass(NAV_DIS);
			$cite.attr("dtree-disabled", "true");
			$cite.addClass(NAV_DIS);
		}
	};

	/**
	 * @Desc: å°†èŠ‚ç‚¹çš„disabledå–æ¶ˆ
	 * @Param: disabledIdsï¼š éœ€è¦è®¾ç½®å–æ¶ˆç¦ç”¨çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„
	 */
	DTree.prototype.cancelDisabledNodes = function(disabledIds){
		var _this = this;
		var disabledId = [];
		if(typeof disabledIds === "string") {
			disabledId = disabledIds.split(",");
		} else {
			disabledId = disabledIds;
		}

		if(disabledIds.length) {
			for (var i=0; i<disabledId.length; i++) {
				_this.cancelDisabledNode(_this.getNodeDom(disabledId[i]).div());
			}
		} else {
			_this.cancelDisabledNode(_this.getNodeDom(disabledId+"").div());
		}
	};

	/**
	 * @Desc: å°†èŠ‚ç‚¹çš„disabledå–æ¶ˆ
	 * @Param: $divï¼š JQueryå¯¹è±¡ï¼Œéœ€è¦è®¾ç½®å–æ¶ˆç¦ç”¨çš„èŠ‚ç‚¹
	 */
	DTree.prototype.cancelDisabledNode = function($div){
		var _this = this;
		var $i = $div.children("div."+LI_DIV_CHECKBAR).children("i[data-par]");
		var $cite = $div.children("cite[data-leaf]");
		if($div != null && $div.attr("dtree-disabled") == "true") {
			$div.attr("dtree-disabled", "false");
			$i.attr("dtree-disabled", "false");
			$i.removeClass(NAV_DIS);
			$cite.attr("dtree-disabled", "false");
			$cite.removeClass(NAV_DIS);
		}
	};

	/**
	 * @Desc: èŽ·å–æŒ‡å®šdisabledèŠ‚ç‚¹çš„å€¼
	 * @Param: disabledIdsï¼š éœ€è¦å–å€¼çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„
	 */
	DTree.prototype.getDisabledNodesParam = function(disabledIds){
		var _this = this;
		var disabledId = [];
		if(typeof disabledIds === "string") {
			disabledId = disabledIds.split(",");
		} else {
			disabledId = disabledIds;
		}

		var disabledNodes = [];
		if(disabledIds.length) {
			for (var i=0; i<disabledId.length; i++) {
				var $div = _this.getNodeDom(disabledId[i]).div();
				if($div != null && $div.attr("dtree-disabled") == "true") {
					disabledNodes.push(_this.getRequestParam(_this.getTempNodeParam($div)));
				}
			}
		} else {
			var $div = _this.getNodeDom(disabledId+"").div();
			if($div != null && $div.attr("dtree-disabled") == "true") {
				disabledNodes.push(_this.getRequestParam(_this.getTempNodeParam($div)));
			}
		}

		return disabledNodes;
	};

	/**
	 * @Desc: èŽ·å–å…¨éƒ¨disabledèŠ‚ç‚¹çš„å€¼
	 * @Param:
	 */
	DTree.prototype.getAllDisabledNodesParam = function(){
		var _this = this;
		var disabledNodes = [];
		_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='true']").each(function(){
			var $div = $(this);
			disabledNodes.push(_this.getRequestParam(_this.getTempNodeParam($div)));
		});
		return disabledNodes;
	};

	/**
	 * @Desc: è®¾ç½®èŠ‚ç‚¹ä¸ºhide
	 * @Param: hideIdsï¼š éœ€è¦éšè—çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„
	 */
	DTree.prototype.setHideNodes = function(hideIds){
		var _this = this;
		var hideId = [];
		if(typeof hideIds === "string") {
			hideId = hideIds.split(",");
		} else {
			hideId = hideIds;
		}

		if(hideId.length) {
			for (var i=0; i<hideId.length; i++) {
				_this.setHideNode(_this.getNodeDom(hideId[i]).div());
			}
		} else {
			_this.setHideNode(_this.getNodeDom(hideId+"").div());
		}
	};

	/**
	 * @Desc: è®¾ç½®èŠ‚ç‚¹ä¸ºhide
	 * @Param: $divï¼š JQueryå¯¹è±¡ï¼Œéœ€è¦è®¾ç½®éšè—çš„èŠ‚ç‚¹
	 */
	DTree.prototype.setHideNode = function($div){
		var _this = this;
		var $li = $div.parent("li[dtree-hide]");
		if($div != null && $div.attr("dtree-hide") != "true") {
			$div.attr("dtree-hide", "true");
			$li.attr("dtree-hide", "true");
			$li.addClass(NAV_HIDE);
		}
	};


	/**
	 * @Desc: å°†èŠ‚ç‚¹çš„hideå–æ¶ˆ
	 * @Param: hideIdsï¼š éœ€è¦å–æ¶ˆéšè—çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„
	 */
	DTree.prototype.cancelHideNodes = function(hideIds){
		var _this = this;
		var hideId = [];
		if(typeof hideIds === "string") {
			hideId = hideIds.split(",");
		} else {
			hideId = hideIds;
		}

		if(hideId.length) {
			for (var i=0; i<hideId.length; i++) {
				_this.cancelHideNode(_this.getNodeDom(hideId[i]).div());
			}
		} else {
			_this.cancelHideNode(_this.getNodeDom(hideId+"").div());
		}

	};

	/**
	 * @Desc: è®¾ç½®èŠ‚ç‚¹ä¸ºhide
	 * @Param: $divï¼š JQueryå¯¹è±¡ï¼Œéœ€è¦è®¾ç½®å–æ¶ˆéšè—çš„èŠ‚ç‚¹
	 */
	DTree.prototype.cancelHideNode = function($div){
		var _this = this;
		var $li = $div.parent("li[dtree-hide]");
		if($div != null && $div.attr("dtree-hide") == "true") {
			$div.attr("dtree-hide", "false");
			$li.attr("dtree-hide", "false");
			$li.removeClass(NAV_HIDE);
		}
	};

	/**
	 * @Desc:  èŽ·å–æŒ‡å®šhideèŠ‚ç‚¹çš„å€¼
	 * @Param: hideIdsï¼š éœ€è¦å–å€¼çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„
	 */
	DTree.prototype.getHideNodesParam = function(hideIds){
		var _this = this;
		var hideId = [];
		if(typeof hideIds === "string") {
			hideId = hideIds.split(",");
		} else {
			hideId = hideIds;
		}

		var hideNodes = [];
		if(hideId.length) {
			for (var i=0; i<hideId.length; i++) {
				var $div = _this.getNodeDom(hideId[i]).div();
				if($div != null && $div.attr("dtree-hide") == "true") {
					hideNodes.push(_this.getRequestParam(_this.getTempNodeParam($div)));
				}
			}
		} else {
			var $div = _this.getNodeDom(hideId+"").div();
			if($div != null && $div.attr("dtree-hide") == "true") {
				hideNodes.push(_this.getRequestParam(_this.getTempNodeParam($div)));
			}
		}
		return hideNodes;
	};

	/**
	 * @Desc:  èŽ·å–å…¨éƒ¨hideèŠ‚ç‚¹çš„å€¼
	 */
	DTree.prototype.getAllHideNodesParam = function(){
		var _this = this;
		var hideNodes = [];
		_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][dtree-hide='true']").each(function(){
			var $div = $(this);
			hideNodes.push(_this.getRequestParam(_this.getTempNodeParam($div)));
		});
		return hideNodes;
	};

	/**
	 * @Desc: åˆ·æ–°æ ‘ï¼Œ1.æ¸…ç©ºæ ‘ç»“æž„ï¼Œ2.æ¸…ç©ºå‚æ•°ï¼Œ3.æ‰§è¡Œåˆå§‹åŒ–æ–¹æ³•
	 */
	DTree.prototype.refreshTree = function(){
		var _this = this;
		_this.obj.html("");	// æ¸…ç©ºæ ‘ç»“æž„
		_this.initNodeParam(); // æ¸…ç©ºå‚æ•°
		_this.init(); // æ‰§è¡Œåˆå§‹åŒ–æ–¹æ³•
	}

	/**
	 * @Desc: å±€éƒ¨åˆ·æ–°æ ‘--æ–°å¢žå­èŠ‚ç‚¹æ—¶
	 * @Param: $div: JQueryå¯¹è±¡ï¼Œå½“å‰æ–°å¢žèŠ‚ç‚¹çš„çˆ¶èŠ‚ç‚¹Div
	 * @Param: dataï¼š å½“å‰éœ€è¦æ¸²æŸ“çš„æ•°æ®ï¼ŒJSONå¯¹è±¡ã€JSONé›†åˆï¼Œå¦‚ä¸å¡«ï¼Œåˆ™è°ƒç”¨getChildæ–¹æ³•è°ƒç”¨æœåŠ¡å™¨åŠ è½½æ•°æ®
	 */
	DTree.prototype.partialRefreshAdd = function($div, data){
		var _this = this;
		$ul = $div.next("ul");

		// åˆ¤æ–­å½“å‰ç‚¹å‡»çš„èŠ‚ç‚¹æ˜¯å¦æ˜¯æœ€åŽä¸€çº§èŠ‚ç‚¹ï¼Œå¦‚æžœæ˜¯ï¼Œåˆ™éœ€è¦ä¿®æ”¹èŠ‚ç‚¹çš„æ ·å¼
		var $icon_i = $div.find("i[data-spread]");
		if ($icon_i.eq(0).attr("data-spread") == "last") {
			_this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).openWithLeaf();
		} else {	//å¦‚æžœä¸æ˜¯ï¼Œä¹Ÿè¦ä¿®æ”¹èŠ‚ç‚¹æ ·å¼
			_this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).open();
		}
		$ul.addClass(NAV_SHOW);	//å±•å¼€UL
		_this.accordionUL($ul);

		if(data) {
			if(data.length && data.length > 0) {
				_this.getChild($div, data);
			} else {
				var parseData = _this.parseData(data);

				if(parseData.treeId()){
					var level = parseInt($div.parent("li").attr("data-index"))+1;
					$ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(0), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), "item"));

					// å»ºé€ å®Œæ¯•åŽï¼Œé€‰ä¸­è¯¥DIV
					$thisDiv = $ul.find("div[data-id='"+parseData.treeId()+"']");
					_this.setNodeParam($thisDiv);

					_this.showLine($ul.find("li"));
				} else {
					layer.msg("æ·»åŠ å¤±è´¥,èŠ‚ç‚¹IDä¸ºundefinedï¼",{icon:5});
					// é‡æ–°èµ‹å€¼
					_this.setNodeParam($div);
				}
			}
		} else {
			_this.getChild($div);
		}
	}

	/**
	 * @Desc: å±€éƒ¨åˆ·æ–°æ ‘--ç¼–è¾‘å½“å‰èŠ‚ç‚¹é€‰ä¸­èŠ‚ç‚¹æ—¶
	 * @Param: $div: JQueryå¯¹è±¡ï¼Œå½“å‰ç¼–è¾‘èŠ‚ç‚¹çš„Div
	 * @Param: dataï¼š å½“å‰éœ€è¦æ¸²æŸ“çš„æ•°æ®ï¼ŒJSONå¯¹è±¡ã€å­—ç¬¦ä¸²
	 */
	DTree.prototype.partialRefreshEdit = function($div, data){
		var _this = this;
		$ul = $div.next("ul"),
			$p_li = $div.parent("li");

		if(data) {
			if(typeof data === 'object') {
				var parseData = _this.parseData(data);

				if(parseData.treeId()){
					var replaceDom = _this.replaceDom($div, parseData.treeId(), parseData.last(0), parseData.spread(), parseData.disabled(), parseData.hide());
					replaceDom.div();
					replaceDom.node(parseData.iconClass());
					replaceDom.checkbox(parseData.checkArr());
					replaceDom.text(parseData.title(),parseData.fmtTitle());
					replaceDom.ul();
					replaceDom.basicData(parseData.basicData());
					replaceDom.recordData(parseData.recordData());

					var parentId = parseData.parentId();
					var oldParentId = $p_li.attr("data-pid");
					if(parentId && parentId != oldParentId) {
						// å˜æ›´äº†çˆ¶èŠ‚ç‚¹
						$p_li = replaceDom.p_li(parentId);

						// æ ¹æ®parentIdæ‰¾åˆ°ä¸‹æŒ‚èŠ‚ç‚¹çš„ul
						var $goto_div = _this.getNodeDom(parentId).div(),
							$goto_ul = _this.getNodeDom(parentId).nextUl();
						// åˆ¤æ–­çˆ¶çº§ulä¸­æ˜¯å¦è¿˜å­˜åœ¨li,å¦‚æžœä¸å­˜åœ¨ï¼Œåˆ™éœ€è¦ä¿®æ”¹èŠ‚ç‚¹çš„æ ·å¼
						if($goto_ul.children("li").length == 0){
							var $icon_i = $goto_div.find("i[data-spread]");
							_this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).openWithLeaf();
							$goto_ul.addClass(NAV_SHOW);
						}
						$goto_ul.append($p_li);
					} else {
						replaceDom.p_li();
					}
					_this.setNodeParam($div);
				} else {
					layer.msg("ç¼–è¾‘å¤±è´¥,èŠ‚ç‚¹IDä¸ºundefinedï¼",{icon:5});
					// é‡æ–°èµ‹å€¼
					_this.setNodeParam($div);
				}
			} else {
				_this.getNodeDom($div).cite().html(data);
			}
		}
	}

	/**
	 * @Desc: å±€éƒ¨åˆ·æ–°æ ‘--å½“å‰èŠ‚ç‚¹é€‰ä¸­è¢«åˆ é™¤æ—¶
	 * @Param: $div: JQueryå¯¹è±¡ï¼Œå½“å‰è¢«åˆ é™¤èŠ‚ç‚¹çš„Div
	 */
	DTree.prototype.partialRefreshDel = function($div){
		var _this = this;
		$p_li = $div.parent("li");
		$p_ul = _this.getNodeDom($div).parentUl();
		$p_div = _this.getNodeDom($div).parentDiv();

		$p_li.remove();
		_this.showLine($p_ul.find("li"));
		// åˆ¤æ–­çˆ¶çº§ulä¸­æ˜¯å¦è¿˜å­˜åœ¨li,å¦‚æžœä¸å­˜åœ¨ï¼Œåˆ™éœ€è¦ä¿®æ”¹èŠ‚ç‚¹çš„æ ·å¼
		if($p_ul.children("li").length == 0){
			var $icon_i = $p_div.find("i[data-spread]");
			_this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).closeWithLeaf();
		}
		_this.initNodeParam();
	}

	/***
	 * @Desc: æœç´¢èŠ‚ç‚¹ï¼Œä¿ç•™ä¸Šçº§èŠ‚ç‚¹
	 * @paramï¼š valueï¼š ä¼ å…¥çš„èŠ‚ç‚¹åç§°
	 * layui-dtreeç¾¤å‹ï¼š æ²¡æ°´å¹³çš„æ°´ç“¶æä¾›ã€‚
	 */
	DTree.prototype.fuzzySearch = function (value) {
		var _this = this;
		//
		if (value.trim() == '') {
			_this.obj.find("li").removeClass("layui-hide").attr("dtree-hide", false)
			return
		}
		_this.obj.find("li").addClass("layui-hide").attr("dtree-hide", true)

		var cites = []
		var filterMode = _this.filterMode
		/*if (filterMode == 'default') {
            cites = _this.obj.find("li>div cite:contains('" + value + "')");
        }*/
		cites = _this.obj.find("li>div cite:contains('" + value + "')");
		cites.each(function (index, cite) {
			var li = $(cite).parent().parent();
			var curNode = _this.getParam(li.attr("data-id"));
			li.removeClass("layui-hide").attr("dtree-hide", false);
			// æ˜¾ç¤ºæ‰€æœ‰å­çº§
			li.find('ul li').removeClass("layui-hide").attr("dtree-hide", false);
			// æ˜¾ç¤ºæ‰€æœ‰çˆ¶çº§
			li.parents('li').removeClass("layui-hide").attr("dtree-hide", false);
		})
	}

	/******************** å¤é€‰æ¡†åŒºåŸŸ ********************/
	/**
	 * @Desc: åˆå§‹åŒ–å¤é€‰æ¡†çš„å€¼
	 * @Param: chooseIds: éœ€è¦è¢«é€‰ä¸­çš„èŠ‚ç‚¹idå­—ç¬¦ä¸²é›†åˆï¼ˆç”¨,åˆ†å‰²ï¼‰/idæ•°ç»„/idäºŒç»´æ•°ç»„ï¼ˆå¤šçº§å¤é€‰æ¡†ï¼‰
	 */
	DTree.prototype.chooseDataInit = function(chooseIds){
		var _this = this;
		// å¤šçº§å¤é€‰æ¡†äºŒç»´æ•°ç»„
		var chooseIdArrs = [];
		var chooseId = [];
		if(typeof chooseIds === "string") {
			chooseId = chooseIds.split(",");
		} else {
			chooseId = chooseIds;
		}
		if(chooseId.length) {
			// è¯´æ˜Žæ˜¯æ•°ç»„
			for (var i=0; i<chooseId.length; i++) {
				var choose = chooseId[i];
				if(typeof chooseIds !== "string" && choose.length) {
					// è¯´æ˜Žå†…éƒ¨è¿˜æ˜¯ä¸€ä¸ªæ•°ç»„ï¼Œå°†è¿™ä¸ªæ•°ç»„æ”¾å…¥äºŒç»´æ•°ç»„ä¸­
					chooseIdArrs.push(choose);
				}
			}
			if(chooseIdArrs.length == 0) {
				// è¯´æ˜Žåœ¨ä¸Šä¸€æ­¥æ²¡æœ‰æ”¶èŽ·æ•°ç»„ï¼Œé‚£ä¹ˆchooseIdåªä¸ºä¸€ä¸ªidæ•°ç»„
				chooseIdArrs.push(chooseId);
			}

			// éåŽ†äºŒç»´æ•°ç»„è§£æžæ•°æ®åˆå§‹åŒ–é€‰ä¸­
			for(var i=0; i<chooseIdArrs.length; i++) {
				var chooseIdArr = chooseIdArrs[i];
				for (var j=0; j<chooseIdArr.length; j++) {
					var $i = _this.obj.find("i[dtree-click='"+eventName.checkNodeClick+"'][data-type="+i+"][data-id="+chooseIdArr[j]+"]");
					_this.checkStatus($i).check();
				}
			}

		} else {
			var $i = _this.obj.find("i[dtree-click='"+eventName.checkNodeClick+"'][data-id="+chooseId+"]");
			_this.checkStatus($i).check();
		}


		// å±•å¼€é€‰ä¸­èŠ‚ç‚¹çš„çˆ¶èŠ‚ç‚¹
		var $li_parents = _this.obj.find("i[dtree-click='"+eventName.checkNodeClick+"'][data-checked='1']").parents("."+LI_NAV_ITEM);
		$li_parents.children("ul").addClass(NAV_SHOW);
		$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).addClass(_this.usefontStyle.fnode.node.open);
		$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.fnode.node.close)).removeClass(_this.usefontStyle.fnode.node.close);
		$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).addClass(_this.usefontStyle.snode.node.open);
		$li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+event.trimToDot(_this.usefontStyle.snode.node.close)).removeClass(_this.usefontStyle.snode.node.close);
		return _this.getCheckbarNodesParam();
	};

	/**
	 * @Desc: å®žçŽ°å¤é€‰æ¡†ç‚¹å‡»ï¼Œå­é›†é€‰ä¸­çˆ¶çº§ä¹Ÿé€‰ä¸­
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰ç‚¹å‡»çš„checkboxèŠ‚ç‚¹
	 */
	DTree.prototype.checkAllOrNot =  function($i) {
		var _this = this;
		//$i å½“å‰ç‚¹å‡»çš„checkbox
		var dataPar = $i.attr("data-par"),
			dataType = $i.attr("data-type"),
			$li = $i.closest(dataPar),		//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹
			$parent_li = $i.parents(dataPar),		//å½“å‰checkboxçš„æ‰€æœ‰çˆ¶çº§lièŠ‚ç‚¹
			$child_li = $li.find(dataPar);	//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹ä¸‹çš„æ‰€æœ‰å­çº§lièŠ‚ç‚¹

		if ($i.attr("data-checked") == "1") {
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).noCheck();

			// å¤„ç†å­çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
			_this.checkStatus($child_li_i).noCheck();

			// å¤„ç†çˆ¶çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			for (var i = 1, item = $parent_li; i < item.length; i++) {
				var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length;
				if (flag == 0) {
					//æŠŠçˆ¶çº§åŽ»æŽ‰é€‰ä¸­
					var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
					_this.checkStatus($item_i).noCheck();
				}
			}
		} else {
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).check();

			// å¤„ç†å­çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
			_this.checkStatus($child_li_i).check();

			// å¤„ç†çˆ¶çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			for (var i = 1, item = $parent_li; i < item.length; i++) {
				var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
				//æŠŠçˆ¶çº§é€‰ä¸­
				_this.checkStatus($item_i).check();
			}
		}
	};

	/**
	 * @Desc: å®žçŽ°å¤é€‰æ¡†ç‚¹å‡»ï¼Œ no-all å­é›†é€‰ä¸­çˆ¶çº§åŠé€‰ä¸­ï¼Œå­é›†å…¨é€‰çˆ¶çº§é€‰ä¸­
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰ç‚¹å‡»çš„checkboxèŠ‚ç‚¹
	 */
	DTree.prototype.checkAllOrNoallOrNot =  function($i) {
		var _this = this;
		//$i å½“å‰ç‚¹å‡»çš„checkbox
		var $div = $i.closest("."+LI_DIV_ITEM),
			dataPar = $i.attr("data-par"),
			dataType = $i.attr("data-type"),
			$li = $i.closest(dataPar),		//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹
			$parent_li = $i.parents(dataPar),		//å½“å‰checkboxçš„æ‰€æœ‰çˆ¶çº§lièŠ‚ç‚¹
			$child_li = $li.find(dataPar);	//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹ä¸‹çš„æ‰€æœ‰å­çº§lièŠ‚ç‚¹

		if ($i.attr("data-checked") == "1") {	//å½“å‰å¤é€‰æ¡†ä¸ºé€‰ä¸­çŠ¶æ€ï¼Œç‚¹å‡»åŽå˜ä¸ºæœªé€‰ä¸­çŠ¶æ€
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).noCheck();

			// å¤„ç†å­çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
			_this.checkStatus($child_li_i).noCheck();

			// å¤„ç†çˆ¶çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			for (var i = 1, item = $parent_li; i < item.length; i++) {
				var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length;
				var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
				if (flag == 0) {
					//æŠŠçˆ¶çº§åŽ»æŽ‰é€‰ä¸­
					_this.checkStatus($item_i).noCheck();
				} else {
					//æŠŠçˆ¶çº§åŠé€‰
					_this.checkStatus($item_i).noallCheck();
				}
			}
		} else {		//å½“å‰å¤é€‰æ¡†ä¸ºæœªé€‰ä¸­çŠ¶æ€ï¼Œç‚¹å‡»åŽå˜ä¸ºé€‰ä¸­çŠ¶æ€
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).check();

			// å¤„ç†å­çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
			_this.checkStatus($child_li_i).check();

			// å¤„ç†çˆ¶çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			for (var i = 1, item = $parent_li; i < item.length; i++) {
				var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length;
				var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length;
				var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
				if (flag1 != flag2) {
					// çˆ¶çº§å¤é€‰æ¡†åŠé€‰
					_this.checkStatus($item_i).noallCheck();
				} else {
					// çˆ¶çº§å¤é€‰æ¡†å…¨é€‰
					_this.checkStatus($item_i).check();
				}
			}
		}
	};

	/**
	 * @Desc: å®žçŽ°å¤é€‰æ¡†ç‚¹å‡»ï¼Œp-cascï¼šçˆ¶çº§é€‰ä¸­å­é›†å…¨é€‰ï¼Œå­é›†æ— æ³•æ”¹å˜çˆ¶çº§é€‰ä¸­çŠ¶æ€
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰ç‚¹å‡»çš„checkboxèŠ‚ç‚¹
	 */
	DTree.prototype.checkAllOrPcascOrNot = function($i) {
		var _this = this;
		//$i å½“å‰ç‚¹å‡»çš„checkbox
		var $div = $i.closest("."+LI_DIV_ITEM),
			dataPar = $i.attr("data-par"),
			dataType = $i.attr("data-type"),
			$li = $i.closest(dataPar),		//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹
			$parent_li = $i.parents(dataPar),		//å½“å‰checkboxçš„æ‰€æœ‰çˆ¶çº§lièŠ‚ç‚¹
			$child_li = $li.find(dataPar);	//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹ä¸‹çš„æ‰€æœ‰å­çº§lièŠ‚ç‚¹

		if ($i.attr("data-checked") == "1") {	//å½“å‰å¤é€‰æ¡†ä¸ºé€‰ä¸­çŠ¶æ€ï¼Œç‚¹å‡»åŽå˜ä¸ºæœªé€‰ä¸­çŠ¶æ€
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).noCheck();

			// å¤„ç†å­çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
			_this.checkStatus($child_li_i).noCheck();

		} else {		//å½“å‰å¤é€‰æ¡†ä¸ºæœªé€‰ä¸­çŠ¶æ€ï¼Œç‚¹å‡»åŽå˜ä¸ºé€‰ä¸­çŠ¶æ€
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).check();

			// å¤„ç†å­çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
			_this.checkStatus($child_li_i).check();
		}
	};

	/**
	 * @Desc: å®žçŽ°å¤é€‰æ¡†ç‚¹å‡»ï¼Œselfï¼šå„è‡ªé€‰ä¸­äº’ä¸å½±å“
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰ç‚¹å‡»çš„checkboxèŠ‚ç‚¹
	 */
	DTree.prototype.checkOrNot = function($i) {
		var _this = this;
		//$i å½“å‰ç‚¹å‡»çš„checkbox
		var $div = $i.closest("."+LI_DIV_ITEM),
			dataPar = $i.attr("data-par"),
			dataType = $i.attr("data-type"),
			$li = $i.closest(dataPar),		//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹
			$parent_li = $i.parents(dataPar),		//å½“å‰checkboxçš„æ‰€æœ‰çˆ¶çº§lièŠ‚ç‚¹
			$child_li = $li.find(dataPar);	//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹ä¸‹çš„æ‰€æœ‰å­çº§lièŠ‚ç‚¹

		if ($i.attr("data-checked") == "1") {	//å½“å‰å¤é€‰æ¡†ä¸ºé€‰ä¸­çŠ¶æ€ï¼Œç‚¹å‡»åŽå˜ä¸ºæœªé€‰ä¸­çŠ¶æ€
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).noCheck();
		} else {		//å½“å‰å¤é€‰æ¡†ä¸ºæœªé€‰ä¸­çŠ¶æ€ï¼Œç‚¹å‡»åŽå˜ä¸ºé€‰ä¸­çŠ¶æ€
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).check();
		}
	};

	/**
	 * @Desc: å®žçŽ°å¤é€‰æ¡†ç‚¹å‡»ï¼Œonlyï¼šåªèƒ½é€‰ä¸­1ä¸ªå¤é€‰æ¡†
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰ç‚¹å‡»çš„checkboxèŠ‚ç‚¹
	 */
	DTree.prototype.checkOnly = function($i) {
		var _this = this;
		//$i å½“å‰ç‚¹å‡»çš„checkbox
		var $div = $i.closest("."+LI_DIV_ITEM),
			dataPar = $i.attr("data-par"),
			dataType = $i.attr("data-type"),
			$li = $i.closest(dataPar),		//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹
			$parent_li = $i.parents(dataPar),		//å½“å‰checkboxçš„æ‰€æœ‰çˆ¶çº§lièŠ‚ç‚¹
			$child_li = $li.find(dataPar);	//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹ä¸‹çš„æ‰€æœ‰å­çº§lièŠ‚ç‚¹

		var checked = $i.attr("data-checked");
		// å°†å…¨éƒ¨èŠ‚ç‚¹å…¨éƒ¨è®¾ä¸ºæœªé€‰ä¸­çŠ¶æ€
		var $all_i = _this.obj.find("i[data-checked]");
		_this.checkStatus($all_i).noCheck();

		if (checked != "1") {	//å½“å‰å¤é€‰æ¡†ä¸ºæœªé€‰ä¸­çŠ¶æ€ï¼Œç‚¹å‡»åŽå˜ä¸ºé€‰ä¸­çŠ¶æ€
			// å¤„ç†å½“å‰èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
			_this.checkStatus($i).check();
		}
	};

	/**
	 * @Desc: å®žçŽ°å¤é€‰æ¡†ç‚¹å‡»æ±‡æ€»ï¼Œåˆ†æ´¾å…·ä½“çš„ç‚¹å‡»æ–¹å¼
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰ç‚¹å‡»çš„checkboxèŠ‚ç‚¹
	 */
	DTree.prototype.changeCheck = function($i) {
		var _this = this;
		var temp = _this.temp;
		if(typeof $i === 'undefined') {
			$i = temp[0];
		}
		// å¤é€‰æ¡†é€‰ä¸­äº‹ä»¶
		if (_this.checkbarType == "all") {
			_this.checkAllOrNot($i);
		} else if(_this.checkbarType == "no-all") {
			_this.checkAllOrNoallOrNot($i);
		} else if(_this.checkbarType == "p-casc") {
			_this.checkAllOrPcascOrNot($i);
		} else if(_this.checkbarType == "self") {
			_this.checkOrNot($i);
		} else if(_this.checkbarType == "only") {
			_this.checkOnly($i);
		} else {
			_this.checkAllOrNot($i);
		}

		if(_this.select) {
			// è®¾ç½®å¤é€‰æ¡†æ¨¡å¼ä¸­çš„ä¸‹æ‹‰æ ‘çš„å€¼
			_this.selectCheckboxVal();
		}

		// èŽ·å–å¤é€‰æ¡†é€‰ä¸­èŠ‚ç‚¹çš„å†…å®¹
		var checkbarNodes = _this.setAndGetCheckbarNodesParam(true);

		// ç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
		_this.checkbarFun.chooseDone(checkbarNodes);
		layui.event.call(this, MOD_NAME, "chooseDone("+$(_this.obj)[0].id+")", {"checkbarParams": checkbarNodes});
		_this.temp = [];
	};

	/**
	 * @Desc: å¤é€‰æ¡†åŠé€‰çŠ¶æ€åˆå§‹åŒ–è®¾ç½®ï¼Œæ ‘èŠ‚ç‚¹æ¸²æŸ“å®Œæ¯•åŽé‡ç½®åŠé€‰çŠ¶æ€
	 */
	DTree.prototype.initNoAllCheck = function(){
		var _this = this;
		//1.èŽ·å–æ‰€æœ‰é€‰ä¸­èŠ‚ç‚¹
		var $is = _this.obj.find("i[data-checked='1']");
		if($is.length > 0){
			for ( var key = 0; key < $is.length; key++) {
				var $i = $($is[key]),
					dataPar = $i.attr("data-par"),
					dataType = $i.attr("data-type"),
					$li = $i.closest(dataPar),		//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹
					$parent_li = $i.parents(dataPar),		//å½“å‰checkboxçš„æ‰€æœ‰çˆ¶çº§lièŠ‚ç‚¹
					$child_li = $li.find(dataPar);	//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹ä¸‹çš„æ‰€æœ‰å­çº§lièŠ‚ç‚¹

				// å¤„ç†çˆ¶çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
				for (var i = 1, item = $parent_li; i < item.length; i++) {
					var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length;
					var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length;
					var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
					if (flag1 != flag2) {
						// çˆ¶çº§å¤é€‰æ¡†åŠé€‰
						_this.checkStatus($item_i).noallCheck();
					} else {
						// çˆ¶çº§å¤é€‰æ¡†å…¨é€‰
						_this.checkStatus($item_i).check();
					}
				}
			}
		}
	};

	/**
	 * @Desc: å¤é€‰æ¡†é€‰ä¸­çŠ¶æ€åˆå§‹åŒ–è®¾ç½®ï¼Œæ ‘èŠ‚ç‚¹æ¸²æŸ“å®Œæ¯•åŽé‡ç½®é€‰ä¸­çŠ¶æ€
	 */
	DTree.prototype.initAllCheck = function(){
		var _this = this;
		//1.èŽ·å–æ‰€æœ‰é€‰ä¸­èŠ‚ç‚¹
		var $is = _this.obj.find("i[data-checked='1']");
		if($is.length > 0){
			for ( var key = 0; key < $is.length; key++) {
				var $i = $($is[key]),
					dataPar = $i.attr("data-par"),
					dataType = $i.attr("data-type"),
					$li = $i.closest(dataPar),		//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹
					$parent_li = $i.parents(dataPar),	//å½“å‰checkboxçš„æ‰€æœ‰çˆ¶çº§lièŠ‚ç‚¹
					$child_li = $li.find(dataPar);	//å½“å‰checkboxçš„ä¸Šçº§lièŠ‚ç‚¹ä¸‹çš„æ‰€æœ‰å­çº§lièŠ‚ç‚¹

				// å¤„ç†çˆ¶çº§èŠ‚ç‚¹çš„é€‰ä¸­çŠ¶æ€
				for (var i = 1, item = $parent_li; i < item.length; i++) {
					var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']");
					// çˆ¶çº§å¤é€‰æ¡†å…¨é€‰
					_this.checkStatus($item_i).check();
				}
			}
		}
	};

	/**
	 * @Desc: è®¾ç½®å¤é€‰æ¡†é€‰ä¸­/æœªé€‰ä¸­/åŠé€‰  _this.checkStatus($i).check();  _this.checkStatus($i).noCheck();   _this.checkStatus($i).noallCheck();
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰ç‚¹å‡»çš„checkboxèŠ‚ç‚¹
	 */
	DTree.prototype.checkStatus = function($i) {
		var _this = this;
		return {
			check: function(){
				$i.removeClass(_this.usefontStyle.checkbox.out);
				$i.removeClass(_this.usefontStyle.checkbox.noall);
				$i.addClass(_this.usefontStyle.checkbox.on);
				$i.addClass(_this.style.chs);
				$i.attr("data-checked","1");
			},
			noCheck: function(){
				$i.removeClass(_this.usefontStyle.checkbox.noall);
				$i.removeClass(_this.usefontStyle.checkbox.on);
				$i.removeClass(_this.style.chs);
				$i.addClass(_this.usefontStyle.checkbox.out);
				$i.attr("data-checked","0");
			},
			noallCheck: function(){
				$i.removeClass(_this.usefontStyle.checkbox.out);
				$i.removeClass(_this.usefontStyle.checkbox.on);
				$i.addClass(_this.usefontStyle.checkbox.noall);
				$i.addClass(_this.style.chs);
				$i.attr("data-checked","2");
			}
		}
	};

	/**
	 * @Desc: è®¾ç½®æ ‘çš„å¤é€‰æ¡†æ“ä½œå€¼çš„å…¨éƒ¨å‚æ•°,å¹¶èŽ·å–
	 * @Param: requestParamFlag: è®¾ç½®å¤é€‰æ¡†è¿”å›žå€¼çš„æ•°æ®ç»“æž„ï¼Œ trueï¼šåŸºäºŽè¯·æ±‚ç±»åž‹çš„è¿”å›žå¯¹è±¡æ•°ç»„ï¼Œ falseï¼šåŽŸå§‹çš„èŠ‚ç‚¹è¿”å›žå¯¹è±¡æ•°ç»„
	 */
	DTree.prototype.setAndGetCheckbarNodesParam = function(requestParamFlag) {
		var _this = this;
		//æ“ä½œå‰å…ˆæ¸…ç©º
		_this.checkbarNode = [];
		// é€‰æ‹©æ‰€æœ‰å¤é€‰æ¡†èŠ‚ç‚¹
		if (_this.checkbarData == "change"){	//è®°å½•å˜æ›´æ•°æ®
			_this.obj.find("i[data-par][dtree-disabled='false']").each(function(){
				var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM);
				if ($i.attr("data-checked") != $i.attr("data-initchecked")) {
					if(requestParamFlag) {
						_this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i)));
					} else {
						_this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i));
					}
				}
			});
		} else if (_this.checkbarData == "all"){	//è®°å½•å…¨éƒ¨æ•°æ®
			_this.obj.find("i[data-par][data-checked][dtree-disabled='false']").each(function(){
				var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM);
				if(requestParamFlag) {
					_this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i)));
				} else {
					_this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i));
				}
			});
		} else if (_this.checkbarData == "choose"){	//è®°å½•é€‰ä¸­æ•°æ®
			_this.obj.find("i[data-par][data-checked='1'][dtree-disabled='false']").each(function(){
				var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM);
				if(requestParamFlag) {
					_this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i)));
				} else {
					_this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i));
				}
			});
		} else if (_this.checkbarData == "halfChoose"){	//è®°å½•é€‰ä¸­å’ŒåŠé€‰æ•°æ®
			_this.obj.find("i[data-par][data-checked='1'][dtree-disabled='false']").each(function(){
				var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM);
				if(requestParamFlag) {
					_this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i)));
				} else {
					_this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i));
				}
			});
			_this.obj.find("i[data-par][data-checked='2'][dtree-disabled='false']").each(function(){
				var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM);
				if(requestParamFlag) {
					_this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i)));
				} else {
					_this.checkbarNode.push(_this.getCheckbarNodeParam($div, $i));
				}
			});
		}
		return _this.checkbarNode;
	};

	/**
	 * @Desc: èŽ·å–æ ‘çš„å¤é€‰æ¡†æ“ä½œå€¼çš„å…¨éƒ¨å‚æ•°
	 */
	DTree.prototype.getCheckbarNodesParam = function() {
		var _this = this;
		return _this.setAndGetCheckbarNodesParam(true);
	};

	/**
	 * @Desc: èŽ·å–æ ‘çš„ä¸€ä¸ªå¤é€‰æ¡†çš„å‚æ•°
	 * @Param: $div: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰é€‰ä¸­èŠ‚ç‚¹
	 * @Param: $i: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰é€‰ä¸­çš„å¤é€‰æ¡†èŠ‚ç‚¹
	 */
	DTree.prototype.getCheckbarNodeParam = function($div, $i){
		var _this = this;
		var temp_node = {};
		temp_node.nodeId = $div.attr("data-id");
		temp_node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid");
		temp_node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text();
		temp_node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false;
		temp_node.level = _this.getNodeDom($div).parentLi().attr("data-index");
		temp_node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false;

		var basicData = $div.attr("data-basic");
		if(basicData) {
			basicData = JSON.parse(event.unescape(basicData));
		}
		temp_node.basicData = basicData;
		var recordData = $div.attr("data-record");
		if(recordData) {
			recordData = JSON.parse(event.unescape(recordData));
		}
		temp_node.recordData = recordData;

		temp_node.dataType = $i.attr("data-type");
		temp_node.checked = $i.attr("data-checked");
		temp_node.initchecked = $i.attr("data-initchecked");
		return temp_node;
	};

	/**
	 * @Desc: èŽ·å–åŸºäºŽè¿”å›žå‚æ•°çš„æ ‘çš„å¤é€‰æ¡†å‚æ•°ï¼Œé€‰ä¸­æ•°æ®æ¨ªå‘å­˜å‚¨
	 */
	DTree.prototype.getCheckbarJsonArrParam = function(){
		var _this = this;
		var checkbarJsonArr = {
			nodeId: [],		//èŠ‚ç‚¹ID
			parentId: [],	//çˆ¶èŠ‚ç‚¹ID
			context: [],	//èŠ‚ç‚¹å†…å®¹
			leaf: [],		//æ˜¯å¦å¶å­èŠ‚ç‚¹
			level: [],		//å±‚çº§
			spread: [],		//èŠ‚ç‚¹å±•å¼€çŠ¶æ€
			dataType: [],	//èŠ‚ç‚¹æ ‡è®°
			checked: [],	//èŠ‚ç‚¹å¤é€‰æ¡†é€‰ä¸­çŠ¶æ€
			initchecked: [],	//èŠ‚ç‚¹å¤é€‰æ¡†åˆå§‹çŠ¶æ€
			basicData: [],		//ç”¨æˆ·è‡ªå®šä¹‰çš„è®°å½•èŠ‚ç‚¹æ•°æ®
			recordData: [],		//å½“å‰dataæ•°æ®ï¼ˆæŽ’é™¤basicDataå’Œchildrenå­—æ®µï¼‰
		};
		// èŽ·å–å…¨éƒ¨å¤é€‰æ¡†é€‰ä¸­èŠ‚ç‚¹
		var params = _this.setAndGetCheckbarNodesParam(false);
		if(params && params.length > 0) {
			for(var i=0; i<params.length; i++) {
				var param = params[i];
				checkbarJsonArr["nodeId"].push(param["nodeId"]);
				checkbarJsonArr["parentId"].push(param["parentId"]);
				checkbarJsonArr["context"].push(param["context"]);
				checkbarJsonArr["leaf"].push(param["leaf"]);
				checkbarJsonArr["level"].push(param["level"]);
				checkbarJsonArr["spread"].push(param["spread"]);
				checkbarJsonArr["dataType"].push(param["dataType"]);
				checkbarJsonArr["checked"].push(param["checked"]);
				checkbarJsonArr["initchecked"].push(param["initchecked"]);
				checkbarJsonArr["basicData"].push(param["basicData"]);
				checkbarJsonArr["recordData"].push(param["recordData"]);
			}
		}

		checkbarJsonArr = _this.getRequestParam(checkbarJsonArr);
		return checkbarJsonArr;
	};

	/**
	 * @Desc: åˆ¤æ–­å¤é€‰æ¡†æ˜¯å¦å‘ç”Ÿå˜æ›´
	 */
	DTree.prototype.changeCheckbarNodes = function(){
		var _this = this;
		_this.obj.find("i[data-par]").each(function(){
			var $i = $(this);
			$div = $i.closest("."+LI_DIV_ITEM);

			if ($i.attr("data-checked") != $i.attr("data-initchecked")) {
				return true;
			}
		});
		return false;
	};

	/**
	 * @Desc: ç‚¹å‡»èŠ‚ç‚¹é€‰ä¸­/ä¸é€‰ å¤é€‰æ¡†
	 * @Param: nodeIdï¼š å½“å‰èŠ‚ç‚¹çš„ID
	 */
	DTree.prototype.clickNodeCheckbar = function(nodeId){
		var _this = this;
		var $checkbar = _this.getNodeDom(nodeId).checkbox();
		_this.temp = [$checkbar];
		_this.changeCheck();
	}

	/**
	 * @Desc: å¤é€‰æ¡†å…¨é€‰
	 */
	DTree.prototype.checkAllNode = function(){
		var _this = this;
		var $i = _this.obj.find("i[data-par][data-checked!='1']");
		if($i.length > 0) { _this.checkStatus($i).check(); }
	}

	/**
	 * @Desc: å–æ¶ˆå…¨éƒ¨å¤é€‰æ¡†é€‰ä¸­
	 */
	DTree.prototype.cancelCheckedNode = function(){
		var _this = this;
		var $i = _this.obj.find("i[data-par][data-checked!='0']");
		if($i.length > 0) { _this.checkStatus($i).noCheck(); }
	}

	/**
	 * @Desc: åé€‰å¤é€‰æ¡†
	 */
	DTree.prototype.invertCheckedNode = function(){
		var _this = this;
		if(_this.obj.find("i[data-par]").length > 0) {
			var flag = false;
			_this.obj.find("i[data-par]").each(function(){
				var $i = $(this);
				if($i.attr("data-checked") == '2'){
					flag = true;
				}else if($i.attr("data-checked") == '0') {
					_this.checkStatus($i).check();
				}else if($i.attr("data-checked") == '1') {
					_this.checkStatus($i).noCheck();
				}
			});

			if(flag) {
				_this.initNoAllCheck();
			} else {
				_this.initAllCheck();
			}
		}
	}

	/**
	 * @Desc: åˆ é™¤é€‰ä¸­èŠ‚ç‚¹
	 */
	DTree.prototype.removeCheckedNode = function(){
		var _this = this;
		var len = _this.obj.find("i[data-par][data-checked='1']").length;
		if(len == 0){
			layer.msg("è¯·è‡³å°‘é€‰ä¸­ä¸€ä¸ªèŠ‚ç‚¹",{icon:2});
		}else{
			//æ“ä½œå‰å…ˆæ¸…ç©º
			_this.checkbarNode = [];
			// é€‰æ‹©æ‰€æœ‰å¤é€‰æ¡†èŠ‚ç‚¹
			var i_node = {};
			_this.obj.find("i[data-par][data-checked='1']").each(function(){
				var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM);

				_this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i)));
			});

			layer.confirm('ç¡®å®šè¦åˆ é™¤é€‰ä¸­èŠ‚ç‚¹ï¼Ÿ', {icon: 3, title:'åˆ é™¤é€‰ä¸­èŠ‚ç‚¹'}, function(index1){
				var flag = _this.menubarFun.remove(_this.checkbarNode);
				if(flag){
					_this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).next("ul").remove();
					_this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).remove();
					_this.checkbarNode=[];
				}

				layer.close(index1);
			});
		}
	}

	/******************** å·¥å…·æ åŠèœå•æ åŒºåŸŸ ********************/
	/**
	 * @Desc: åˆå§‹åŒ–èœå•æ å’Œå·¥å…·æ çš„div
	 */
	DTree.prototype.initTreePlus = function(){
		var _this = this;
		// åˆå§‹åŒ–èœå•æ å’Œå·¥å…·æ çš„div
		_this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).remove();
		_this.toolbarMenu = {};
		if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0) _this.obj.before("<div class='"+LI_DIV_MENUBAR+"' id='dtree_menubar_"+_this.obj[0].id+"'><div class='layui-btn-group'></div></div>");
		if(_this.toolbar){
			if(_this.toolbarWay == "contextmenu") {
				_this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).remove();
				if(_this.toolbarShow && _this.toolbarShow.length > 0) {
					_this.obj.before("<div class='"+LI_DIV_TOOLBAR+" layui-nav' id='dtree_toolbar_"+_this.obj[0].id+"'><div class='layui-nav-item'><dl class='layui-nav-child layui-anim'></dl></div></div>");
				}
			}
		}

	};

	/**
	 * @Desc: å¼€å¯å·¥å…·æ å’Œèœå•æ 
	 */
	DTree.prototype.openTreePlus = function(){
		var _this = this;
		// å…ˆå¯¹å·¥å…·æ åšå¤„ç†ï¼Œå› ä¸ºèœå•æ å¯èƒ½ä¼šä¸Žå·¥å…·æ äº§ç”Ÿå…³è”ã€‚
		var ggMenu = [];
		if(_this.toolbar) _this.getToolbarDom();

		if(_this.menubar) {
			var menubarTips = _this.menubarTips,
				mtbar = menubarTips.toolbar,
				group = menubarTips.group,
				freedom = menubarTips.freedom;
			if(mtbar && mtbar.length > 0){
				// èœå•æ å¸é™„å·¥å…·æ ä¸Š
				for(var i=0; i<mtbar.length; i++){
					var mt = mtbar[i];
					if(typeof mt === 'string'){
						_this.getMenubarToolDom(mt);
					}
					if(typeof mt === 'object'){
						_this.getExtMenubarToolDom(mt);
					}
				}
			}
			if(group && group.length > 0){
				// èœå•æ å¸é™„åœ¨ä¸Šæ–¹çš„æŒ‰é’®ç»„divä¸­
				for(var i=0; i<group.length; i++){
					var gg = group[i];
					if(typeof gg === 'string'){
						ggMenu.push(_this.getMenubarDom(gg));
					}
					if(typeof gg === 'object'){
						ggMenu.push(_this.getExtMenubarDom(gg));
					}
				}
				_this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).children('div.layui-btn-group').append(ggMenu.join(""));

			}
		}
	};


	/******************** èœå•æ åŒºåŸŸ ********************/
	/**
	 * @Desc: èŽ·å–èœå•æ 
	 * @Param: menu: èœå•æ çš„å…·ä½“æ“ä½œå­—ç¬¦ä¸²
	 */
	DTree.prototype.getMenubarDom = function(menu){
		var _this = this;
		var rootId = _this.obj[0].id;
		var gg = "";
		switch (menu) {
			case defaultMenu.moveDown:
				gg = "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.moveDown+"' title='å±•å¼€å…¨éƒ¨èŠ‚ç‚¹'><i class='"+_this.usefontStyle.menubar.movedown+"'></i></button>";
				break;
			case defaultMenu.moveUp:
				gg = "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.moveUp+"' title='æ”¶ç¼©å…¨éƒ¨èŠ‚ç‚¹'><i class='"+_this.usefontStyle.menubar.moveup+"'></i></button>";
				break;
			case defaultMenu.refresh:
				gg = "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.refresh+"' title='åˆ·æ–°'><i class='"+_this.usefontStyle.menubar.refresh+"'></i></button>";
				break;
			case defaultMenu.checkAll:
				gg = (_this.checkbar && _this.checkbarType != 'only') ? "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.checkAll+"' title='å…¨é€‰èŠ‚ç‚¹'><i class='"+_this.usefontStyle.menubar.checkAll+"'></i></button>" : "";
				break;
			case defaultMenu.unCheckAll:
				gg = (_this.checkbar && _this.checkbarType != 'only') ? "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.unCheckAll+"' title='å…¨ä¸é€‰èŠ‚ç‚¹'><i class='"+_this.usefontStyle.menubar.unCheckAll+"'></i></button>" : "";
				break;
			case defaultMenu.invertAll:
				gg = (_this.checkbar && _this.checkbarType != 'only') ? "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.invertAll+"' title='åé€‰èŠ‚ç‚¹'><i class='"+_this.usefontStyle.menubar.invertAll+"'></i></button>" : "";
				break;
			case defaultMenu.remove:
				gg = (_this.checkbar) ? "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.remove+"' title='åˆ é™¤é€‰ä¸­èŠ‚ç‚¹'><i class='"+_this.usefontStyle.menubar.remove+"'></i></button>" : "";
				break;
			case defaultMenu.searchNode:
				gg = "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+rootId+"' d-menu='"+defaultMenu.searchNode+"' title='æŸ¥è¯¢èŠ‚ç‚¹'><i class='"+_this.usefontStyle.menubar.search+"'></i></button>";
				break;
		}
		return gg;
	};

	/**
	 * @Desc: èŽ·å–æ‰©å±•èœå•æ 
	 * @Param: menu: æ‰©å±•èœå•æ çš„Jsonå¯¹è±¡
	 */
	DTree.prototype.getExtMenubarDom = function(menu){
		var _this = this;
		return "<button type='button' class='layui-btn layui-btn-sm layui-btn-primary' dtree-id='"+_this.obj[0].id+"' d-menu='"+menu.menubarId+"' title='"+menu.title+"'><i class='"+_this.usefontStyle.menubarExt+" "+menu.icon+"'></i></button>";
	};

	/**
	 * @Desc: èŽ·å–ä¾é™„åœ¨å·¥å…·æ çš„èœå•æ 
	 * @Param: menu: èœå•æ çš„å…·ä½“æ“ä½œå­—ç¬¦ä¸²
	 */
	DTree.prototype.getMenubarToolDom = function(menu){
		var _this = this;
		var rootId = _this.obj[0].id;
		switch (menu) {
			case defaultMenu.moveDown:
				_this.toolbarMenu[defaultMenu.moveDown] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.moveDown, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.movedown, "å±•å¼€å…¨éƒ¨");
				break;
			case defaultMenu.moveUp:
				_this.toolbarMenu[defaultMenu.moveUp] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.moveUp, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.moveup, "æ”¶ç¼©å…¨éƒ¨");
				break;
			case defaultMenu.refresh:
				_this.toolbarMenu[defaultMenu.refresh] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.refresh, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.refresh, "åˆ·æ–°");
				break;
			case defaultMenu.checkAll:
				if(_this.checkbar && _this.checkbarType != 'only')
					_this.toolbarMenu[defaultMenu.checkAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.checkAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.checkAll, "å…¨é€‰èŠ‚ç‚¹");
				break;
			case defaultMenu.unCheckAll:
				if(_this.checkbar && _this.checkbarType != 'only')
					_this.toolbarMenu[defaultMenu.unCheckAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.unCheckAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.unCheckAll, "å…¨ä¸é€‰èŠ‚ç‚¹");
				break;
			case defaultMenu.invertAll:
				if(_this.checkbar && _this.checkbarType != 'only')
					_this.toolbarMenu[defaultMenu.invertAll] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.invertAll, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.invertAll, "åé€‰èŠ‚ç‚¹");
				break;
			case defaultMenu.remove:
				if(_this.checkbar)
					_this.toolbarMenu[defaultMenu.remove] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.remove, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.remove, "åˆ é™¤é€‰ä¸­");
				break;
			case defaultMenu.searchNode:
				_this.toolbarMenu[defaultMenu.searchNode] = _this.setToolbarDom().setMenuToolbarOption(defaultMenu.searchNode, _this.toolbarStyle.title, _this.usefontStyle.toolbar.menubar.searchNode, "æŸ¥è¯¢");
				break;
		}
	};

	/**
	 * @Desc: èŽ·å–ä¾é™„åœ¨å·¥å…·æ çš„æ‰©å±•èœå•æ 
	 * @Param: menu: æ‰©å±•èœå•æ çš„Jsonå¯¹è±¡
	 */
	DTree.prototype.getExtMenubarToolDom = function(menu){
		var _this = this;
		_this.toolbarMenu[menu.menubarId] = _this.setToolbarDom().setMenuToolbarOption(menu.menubarId, menu.title, _this.usefontStyle.toolbar.menubarExt+" "+menu.icon, "");
	};

	/**
	 * @Desc: menubarå†…ç½®æ–¹æ³•
	 */
	DTree.prototype.menubarMethod = function(){
		var _this = this;
		return {
			openAllNode: function(obj){  // å±•å¼€æ‰€æœ‰èŠ‚ç‚¹
				var $ulNode = obj || _this.obj.children("li").children("ul");
				// éåŽ†æ‰€æœ‰ulå­èŠ‚ç‚¹
				for (var i = 0; i < $ulNode.length; i++) {
					// èŽ·å–å½“å‰èŠ‚ç‚¹çš„ä¿¡æ¯
					var $ul = $($ulNode[i]),
						$div = $ul.prev("div"),
						$i_fnode = _this.getNodeDom($div).fnode(),
						$i_snode = _this.getNodeDom($div).snode(),
						$cite = _this.getNodeDom($div).cite(),
						spread = $i_fnode.attr("data-spread"),
						leaf = $cite.attr("data-leaf");

					if (leaf == "leaf") {
						continue;
					}	// è¯´æ˜Žæ˜¯å¶å­äº†ï¼Œåˆ™ç»§ç»­å¾ªçŽ¯ä¸‹ä¸€ä¸ª

					if (spread == "open") {
						// è¯´æ˜Žè¯¥èŠ‚ç‚¹å·²ç»å±•å¼€äº†ï¼Œåˆ™è¿›è¡Œå­èŠ‚ç‚¹å¾ªçŽ¯
					} else {
						if (_this.type=="load") {	//æ˜¯å¦å…¨é‡åŠ è½½
							if (_this.cache) {	//æ˜¯å¦å¼€å¯ç¼“å­˜
								if ($ul.html()) {
									$ul.addClass(NAV_SHOW);
								} else {	//åŠ è½½èŠ‚ç‚¹
									_this.getChild($div);
								}
							}else {	//æ¯æ¬¡å–æ–°çš„æ•°æ®
								$ul.html("");
								_this.getChild($div);
							}
						} else {	// å…¨é‡åŠ è½½
							$ul.addClass(NAV_SHOW);
						}
						_this.operateIcon($i_fnode, $i_snode).open();

					}
					var $childUl = $ul.children("li").children("ul");
					_this.menubarMethod().openAllNode($childUl);
				}
			},
			closeAllNode: function(){ //æ”¶ç¼©æ‰€æœ‰èŠ‚ç‚¹
				_this.obj.find("."+LI_NAV_CHILD).each(function(){
					// èŽ·å–å½“å‰èŠ‚ç‚¹çš„ä¿¡æ¯
					var $ul = $(this),
						$div = $ul.prev("div"),
						$i_fnode = _this.getNodeDom($div).fnode(),
						$i_snode = _this.getNodeDom($div).snode(),
						$cite = _this.getNodeDom($div).cite(),
						spread = $i_fnode.attr("data-spread"),
						leaf = $cite.attr("data-leaf");

					$ul.removeClass(NAV_SHOW);
					if(leaf !== "leaf") {
						_this.operateIcon($i_fnode, $i_snode).close();
					}
				});
			},
			refreshTree: function(){// åˆ·æ–°æ ‘
				_this.refreshTree();
			},
			checkAll: function(){ // å…¨é€‰èŠ‚ç‚¹
				_this.checkAllNode();
			},
			unCheckAll: function(){ // å…¨ä¸é€‰èŠ‚ç‚¹
				_this.cancelCheckedNode();
			},
			invertAll: function(){ // åé€‰èŠ‚ç‚¹
				_this.invertCheckedNode();
			},
			remove: function(){// åˆ é™¤é€‰ä¸­èŠ‚ç‚¹
				_this.removeCheckedNode();
			},
			searchNode: function(){//æ¨¡ç³ŠæŸ¥è¯¢è¯¥å€¼ï¼Œå±•å¼€è¯¥å€¼èŠ‚ç‚¹
				layer.prompt({
					formType: 0,
					value: "",
					title: 'æŸ¥è¯¢èŠ‚ç‚¹'
				}, function(value, index1, elem){
					if (value) {
						var flag = _this.searchNode(value);
						if (!flag) {
							layer.msg("è¯¥åç§°èŠ‚ç‚¹ä¸å­˜åœ¨ï¼", {icon:5});
						}
					} else {
						layer.msg("æœªæŒ‡å®šæŸ¥è¯¢èŠ‚ç‚¹åç§°", {icon:5});
					}
					layer.close(index1);
				});
			},
			extMethod: function(menuId, $div, flag){
				if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0 && flag == "group"){
					for(var i=0; i<_this.menubarTips.group.length; i++){
						var ext = _this.menubarTips.group[i];
						if (menuId == ext.menubarId){
							ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div));
							break;
						}
					}
				}
				if(_this.menubar && _this.menubarTips.toolbar && _this.menubarTips.toolbar.length > 0 && flag == "toolbar"){
					for(var i=0; i<_this.menubarTips.toolbar.length; i++){
						var ext = _this.menubarTips.toolbar[i];
						if (menuId == ext.menubarId){
							ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div));
							break;
						}
					}
				}
				if(_this.menubar && _this.menubarTips.freedom && _this.menubarTips.freedom.length > 0 && flag == "freedom"){
					for(var i=0; i<_this.menubarTips.freedom.length; i++){
						var ext = _this.menubarTips.freedom[i];
						if (menuId == ext.menubarId){
							ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div));
							break;
						}
					}
				}
			}
		};
	};

	/**
	 * @Desc: menubarç›‘å¬æ–¹æ³•
	 * @Param: menuIdï¼šèœå•æ çš„å…·ä½“æ“ä½œå­—ç¬¦ä¸²
	 * @Param: flagï¼šèœå•æ çš„æ˜¾ç¤ºæ–¹å¼
	 */
	DTree.prototype.menubarListener = function(menuId, flag){
		var _this = this;
		var $div = _this.getNodeDom().nowDiv();
		switch (menuId) {
			case defaultMenu.moveDown:	// å±•å¼€å…¨éƒ¨èŠ‚ç‚¹
				_this.menubarMethod().openAllNode();
				break;
			case defaultMenu.moveUp:	// æ”¶ç¼©å…¨éƒ¨èŠ‚ç‚¹
				_this.menubarMethod().closeAllNode();
				break;
			case defaultMenu.refresh:
				_this.menubarMethod().refreshTree(); // åˆ·æ–°æ ‘
				break;
			case defaultMenu.checkAll:
				_this.menubarMethod().checkAll();
				break;
			case defaultMenu.unCheckAll:
				_this.menubarMethod().unCheckAll();
				break;
			case defaultMenu.invertAll:
				_this.menubarMethod().invertAll();
				break;
			case defaultMenu.remove:
				_this.menubarMethod().remove();
				break;
			case defaultMenu.searchNode:
				_this.menubarMethod().searchNode();
				break;
			default:
				_this.menubarMethod().extMethod(menuId, $div, flag);
				break;
		}
	};

	/**
	 * @Desc: æ¨¡ç³ŠæŸ¥è¯¢è¯¥å€¼ï¼Œå±•å¼€è¯¥å€¼èŠ‚ç‚¹
	 * @Param: valueï¼š æ¨¡ç³ŠæŸ¥è¯¢çš„å€¼
	 */
	DTree.prototype.searchNode = function(value){
		var _this = this;
		var b = false;
		var $lis = [];
		_this.obj.find("cite[data-leaf]").each(function(){
			var $nthis = $(this);
			var html = $nthis.html();
			if(html.indexOf(value) > -1){
				if($nthis.attr("data-leaf") == "leaf") {
					// å¶å­èŠ‚ç‚¹æä¾›åŒ…å«çˆ¶èŠ‚ç‚¹çš„æ‰€æœ‰ä¿¡æ¯
					var title = "";
					$nthis.parents("li").each(function(){
						title = "-" + $(this).find("cite[data-leaf]").html() + title;
					});
					title = title.substring(1, title.length);
					$nthis.attr("title", title);
				}
				// ä¿å­˜å½“å‰citeæ‰€åœ¨çš„liåŠçˆ¶liä¸­åŒ…å«è¯¥å€¼ï¼Œåˆ™åªä¿ç•™çˆ¶çš„
				var i = 0;
				$nthis.parents("li").each(function(){
					var html2 = $(this).find("cite[data-leaf]").html();
					if(html2.indexOf(value) > -1){
						i++;
					}
					if(i >= 2){
						return true;
					}
				});
				if (i < 2){
					$lis.push($nthis.closest("li").prop("outerHTML"));
				}
			}
		});
		if($lis.length > 0) {
			b = true;
			// 1.å°†æ ‘èŠ‚ç‚¹æ¸…ç©º
			_this.obj.html("");
			// 2.éåŽ†æ‰€æœ‰citeèŠ‚ç‚¹ï¼Œå±•å¼€å½“å‰citeèŠ‚ç‚¹
			for(var i=0; i<$lis.length; i++){
				_this.obj.append($lis[i]);
			}
		}
		return b;
	};


	/******************** å·¥å…·æ åŒºåŸŸ ********************/
	/**
	 * @Desc: èŽ·å–å·¥å…·æ 
	 */
	DTree.prototype.getToolbarDom = function(){
		var _this = this;
		var toolbarShow = _this.toolbarShow,
			toolbarExt = _this.toolbarExt,
			toolbarWay = _this.toolbarWay;

		if(toolbarShow.length > 0){
			for(var i=0; i<toolbarShow.length; i++){
				var show = toolbarShow[i];
				if(show == "pulldown"){
					_this.toolbarMenu[defaultTool.pulldown] = _this.setToolbarDom().setToolbarOption(defaultTool.pulldown, _this.toolbarStyle.title, _this.usefontStyle.toolbar.pulldown, "å±•å¼€");
				}
				if(show == "pullup"){
					_this.toolbarMenu[defaultTool.pullup] = _this.setToolbarDom().setToolbarOption(defaultTool.pullup, _this.toolbarStyle.title, _this.usefontStyle.toolbar.pullup, "æ”¶ç¼©");
				}
				if(show == "add"){
					_this.toolbarMenu[defaultTool.addTool] = _this.setToolbarDom().setToolbarOption(defaultTool.addTool, _this.toolbarStyle.title, _this.usefontStyle.toolbar.add, "æ–°å¢ž");
				}
				if(show == "edit"){
					_this.toolbarMenu[defaultTool.editTool] = _this.setToolbarDom().setToolbarOption(defaultTool.editTool, _this.toolbarStyle.title, _this.usefontStyle.toolbar.edit, "ç¼–è¾‘");
				}
				if(show == "delete"){
					_this.toolbarMenu[defaultTool.delTool] = _this.setToolbarDom().setToolbarOption(defaultTool.delTool, _this.toolbarStyle.title, _this.usefontStyle.toolbar.del, "åˆ é™¤");
				}
			}
		}
		if(toolbarExt.length > 0){
			for(var i=0; i<toolbarExt.length; i++){
				var ext = toolbarExt[i];
				_this.toolbarMenu[ext.toolbarId] = _this.setToolbarDom().setToolbarOption(ext.toolbarId, ext.title, _this.usefontStyle.toolbarExt+" "+ext.icon, "");
			}
		}
	};

	/**
	 * @Desc: è®¾ç½®å·¥å…·æ æŒ‰é’®
	 */
	DTree.prototype.setToolbarDom = function(){
		var _this = this;
		var toolbarWay = _this.toolbarWay;

		return {
			setToolbarOption: function(toolbarId, title, classId, other){
				if(toolbarWay == "contextmenu") {
					return "<dd><a dtree-tool='"+toolbarId+"'><i class='"+classId+"'></i>&nbsp;"+other +title+"</a></dd>";
				} else if(toolbarWay == "fixed" || toolbarWay == "follow") {
					return "<a dtree-tool='"+toolbarId+"' title='"+other + title+"'><i class='"+classId+"'></i></a>";
				}
			},
			setMenuToolbarOption: function(menubarId, title, classId, other){
				var rootId = _this.obj[0].id;
				if(toolbarWay == "contextmenu") {
					return "<dd><a dtree-id='"+rootId+"' d-menu='"+menubarId+"'><i class='"+classId+"'></i>&nbsp;"+other +title+"</a></dd>";
				} else if(toolbarWay == "fixed" || toolbarWay == "follow") {
					return "<a dtree-id='"+rootId+"' d-menu='"+menubarId+"' title='"+other + title+"'><i class='"+classId+"'></i></a>";
				}
			},
			setToolbarPlace: function(toolbarMenu){
				if(toolbarWay == "contextmenu") {
					if(toolbarMenu){
						_this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').html("");
						for(var key in toolbarMenu){
							_this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').append(toolbarMenu[key]);
						}
					}
				} else if(toolbarWay == "fixed" || toolbarWay == "follow") {
					_this.obj.find("cite[data-leaf][dtree-disabled='false']").each(function(){
						var $cite = $(this);
						_this.dynamicToolbarDom($cite);
					});
				}
			}
		}
	};

	/**
	 * @Desc: åœ¨èŠ‚ç‚¹åŽåŠ¨æ€ç»‘å®šfixedå’Œfollowæ¡ä»¶çš„å·¥å…·æ 
	 * @Param: $citeï¼š JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰æ–‡æœ¬èŠ‚ç‚¹
	 */
	DTree.prototype.dynamicToolbarDom = function($cite){
		var _this = this;
		var toolbarWay = _this.toolbarWay;
		if($cite.next("em."+TOOLBAR_TOOL_EM).length == 0) {
			var $div = $cite.parent("div");
			var param = _this.getRequestParam(_this.getTempNodeParam($div));
			var toolbarMenus = _this.toolbarFun.loadToolbarBefore(event.cloneObj(_this.toolbarMenu), param, $div);
			var hideCls = (toolbarWay == "follow") ? NAV_HIDE : "";
			var em = ["<em class='"+TOOLBAR_TOOL_EM+" "+hideCls+"'>"];
			if(toolbarMenus){
				for(var key in toolbarMenus){
					em.push(toolbarMenus[key]);
				}
			}
			em.push("</em>");
			$cite.after(em.join(''));
		}
	}

	/**
	 * @Desc: éšè—toolbar
	 */
	DTree.prototype.toolbarHide = function() {
		var _this = this;
		if(_this.toolbar && _this.toolbarWay == "contextmenu") {
			var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id);
			$toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show');
		}
	}

	/**
	 * @Desc: toolbarå†…ç½®æ–¹æ³•
	 */
	DTree.prototype.toolbarMethod = function(){
		var _this = this;
		return {
			pulldown: function(obj){ // å±•å¼€å½“å‰ç‚¹å‡»èŠ‚ç‚¹çš„ä¸‹é¢å…¨éƒ¨èŠ‚ç‚¹
				if(!obj) return;
				var $ulNode = obj;
				// éåŽ†æ‰€æœ‰ulå­èŠ‚ç‚¹
				for (var i = 0; i < $ulNode.length; i++) {
					// èŽ·å–å½“å‰èŠ‚ç‚¹çš„ä¿¡æ¯
					var $ul = $($ulNode[i]),
						$div = $ul.prev("div"),
						$i_fnode = _this.getNodeDom($div).fnode(),
						$i_snode = _this.getNodeDom($div).snode(),
						$cite = _this.getNodeDom($div).cite(),
						spread = $i_fnode.attr("data-spread"),
						leaf = $cite.attr("data-leaf");

					if (leaf == "leaf") { continue;	}	// è¯´æ˜Žæ˜¯å¶å­äº†ï¼Œåˆ™ç»§ç»­å¾ªçŽ¯ä¸‹ä¸€ä¸ª

					if (spread == "open") {
						// è¯´æ˜Žè¯¥èŠ‚ç‚¹å·²ç»å±•å¼€äº†ï¼Œåˆ™è¿›è¡Œå­èŠ‚ç‚¹å¾ªçŽ¯
					} else {
						if (_this.type=="load") {	//æ˜¯å¦å…¨é‡åŠ è½½
							if (_this.cache) {	//æ˜¯å¦å¼€å¯ç¼“å­˜
								if ($ul.html()) {
									$ul.addClass(NAV_SHOW);
								} else {	//åŠ è½½èŠ‚ç‚¹
									_this.getChild($div);
								}
							}else {	//æ¯æ¬¡å–æ–°çš„æ•°æ®
								$ul.html("");
								_this.getChild($div);
							}
						} else {	// å…¨é‡åŠ è½½
							$ul.addClass(NAV_SHOW);
						}
						_this.operateIcon($i_fnode, $i_snode).open();

					}
					var $childUl = $ul.children("li").children("ul");
					_this.toolbarMethod().pulldown($childUl);
				}
			},
			pullup: function($li){ // æ”¶ç¼©å½“å‰ç‚¹å‡»èŠ‚ç‚¹çš„ä¸‹é¢å…¨éƒ¨èŠ‚ç‚¹
				$li.find("."+LI_NAV_CHILD).each(function(){
					// èŽ·å–å½“å‰èŠ‚ç‚¹çš„ä¿¡æ¯
					var $ul = $(this),
						$div = $ul.prev("div"),
						$i_fnode = _this.getNodeDom($div).fnode(),
						$i_snode = _this.getNodeDom($div).snode(),
						$cite = _this.getNodeDom($div).cite(),
						spread = $i_fnode.attr("data-spread"),
						leaf = $cite.attr("data-leaf");

					$ul.removeClass(NAV_SHOW);
					if(leaf !== "leaf") {
						_this.operateIcon($i_fnode, $i_snode).close();
					}
				});
			}
		}
	};

	/**
	 * @Desc: toolbarç›‘å¬æ–¹æ³•
	 * @Param: tool: å·¥å…·æ çš„å…·ä½“æ“ä½œå­—ç¬¦ä¸²
	 * @Param: $div: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰æ“ä½œèŠ‚ç‚¹
	 */
	DTree.prototype.toolbarListener = function(tool, $div) {
		var _this = this;
		var $cite = $div.children("cite[data-leaf]"),
			$ul = $div.next("ul"),
			$p_li = $div.parent("li[data-index]"),	//å½“å‰é€‰ä¸­èŠ‚ç‚¹çš„é¡¶çº§lièŠ‚ç‚¹
			$p_ul = $p_li.parent("ul"),	//å½“å‰é€‰ä¸­èŠ‚ç‚¹çš„é¡¶çº§lièŠ‚ç‚¹çš„çˆ¶çº§ul
			$p_div = $p_ul.prev("div"), //å½“å‰é€‰ä¸­èŠ‚ç‚¹çš„é¡¶çº§lièŠ‚ç‚¹çš„çˆ¶çº§ulçš„å‰ä¸€ä¸ªdiv
			title = (typeof _this.formatter.title === 'function') ? $cite.attr("data-title") : $cite.text();

		switch (tool) {
			case defaultTool.pulldown:
				_this.toolbarMethod().pulldown($ul);
				break;
			case defaultTool.pullup:
				_this.toolbarMethod().pullup($p_li);
				break;
			case defaultTool.addTool:
				var content = _this.loadToolBar(title, defaultTool.addTool);

				layer.open({
					title: "æ–°å¢ž"+_this.toolbarStyle.title,
					type: 1,
					area: _this.toolbarStyle.area,
					content: content,
					success: function(layero, index){
						form.render();
						form.on("submit(dtree_addNode_" + _this.obj[0].id + "_form)",function(data){
							var data = data.field;
							var parentId = $div.attr("data-id"),
								id = $div.attr("data-id")+"_node_"+$ul[0].childNodes.length,
								leaf = true,
								checked = "0",
								level = parseInt($p_li.attr("data-index"))+1;

							var type = _this.response.type;
							var checked = _this.response.checked;
							// åˆ›å»ºå­èŠ‚ç‚¹çš„DOMï¼Œæ·»åŠ å­èŠ‚ç‚¹
							var checkArr = [];
							if (_this.checkArrLen > 0) {
								for (var i = 0; i < _this.checkArrLen; i++) {
									checkArr.push({type: i, checked: "0"});
								}
							}

							$ul.append(_this.getLiItemDom(id, parentId, data.addNodeName, data.addNodeName, true, "", "", checkArr, level, false, false, false, "", "", "item"));
							// å…ˆå°†lièŠ‚ç‚¹éšè—
							$ul.find("li[data-id='"+id+"']").hide();
							// é‡æ–°èµ‹å€¼
							var $addDiv = $ul.find("div[data-id='"+id+"']");
							node = _this.getNodeParam($addDiv);

							//èŽ·å–ç»„è£…åŽçš„requestNode,ç»„åˆå‚æ•°
							var requestNode = _this.getRequestParam(node);
							requestNode = $.extend(requestNode, data);

							_this.temp = [id, $ul, $div, level];
							// ç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
							_this.toolbarFun.addTreeNode(requestNode, $div);

							layer.close(index);
							return false;
						});
					}
				});
				break;
			case defaultTool.editTool:
				var content = _this.loadToolBar(title, defaultTool.editTool);

				layer.open({
					title: "ç¼–è¾‘"+_this.toolbarStyle.title,
					type: 1,
					area: _this.toolbarStyle.area,
					content: content,
					success: function(layero, index){
						_this.toolbarFun.editTreeLoad(_this.getRequestParam(_this.getNodeParam($div)));
						form.render();
						form.on("submit(dtree_editNode_" + _this.obj[0].id + "_form)",function(data){
							var data = data.field;
							$cite.html(data.editNodeName);
							node = _this.getNodeParam($div);
							var requestNode = _this.getRequestParam(node);
							requestNode = $.extend(requestNode, data);
							_this.temp = [$cite, $div, title, $p_div];
							_this.toolbarFun.editTreeNode(requestNode, $div);

							layer.close(index);
						});
					}
				});
				break;
			case defaultTool.delTool:
				layer.confirm('ç¡®å®šè¦åˆ é™¤è¯¥'+_this.toolbarStyle.title+'ï¼Ÿ', {icon: 3, title:'åˆ é™¤'+_this.toolbarStyle.title}, function(index){
					var node = _this.getNodeParam($div);
					_this.temp = [$p_li, $p_div];
					_this.toolbarFun.delTreeNode(_this.getRequestParam(_this.getNodeParam($div)), $div);

					layer.close(index);
				});
				break;
			default:
				if(_this.toolbarExt.length > 0){
					for(var i=0; i<_this.toolbarExt.length; i++){
						var ext = _this.toolbarExt[i];
						if (tool == ext.toolbarId){
							ext.handler(_this.getRequestParam(_this.getNodeParam($div)), $div);
							break;
						}
					}
				}
				break;
		}
	}


	/**
	 * @Desc: åŠ è½½toolbarä¸­çš„å†…å®¹
	 * @Param: title: é»˜è®¤æ“ä½œä¸­çš„inputè¾“å…¥æ¡†çš„å€¼
	 * @Param: name: å·¥å…·æ çš„å…·ä½“æ“ä½œå­—ç¬¦ä¸²
	 */
	DTree.prototype.loadToolBar = function(title, name){
		var _this = this;
		var toolbarShow = _this.toolbarShow;
		var nodeBarContents = _this.toolbarBtn;

		var html = "";
		switch (name) {
			case defaultTool.addTool:
				var addNodeBarDef = [{"label": "å½“å‰é€‰ä¸­", "name": "nodeTitle", "type": "text", "value": title, "defElem": "nowChoose", "readonly": true},
					{"label": "æ–°å¢ž"+_this.toolbarStyle.title, "name": "addNodeName", "type": "text", "value": "", "defElem": "nowChange", "verify": "required"},
					{"type": "submit", "value": "ç¡®è®¤æ·»åŠ ", "defElem": "btn", "filter": "dtree_addNode_" + _this.obj[0].id + "_form"}];

				//2. ç”¨æˆ·è‡ªå®šä¹‰çš„èŠ‚ç‚¹å†…å®¹
				var addNodeBar = ['<div class="'+TOOLBAR_TOOL+'"><form class="layui-form layui-form-pane" lay-filter="dtree_addNode_' + _this.obj[0].id + '_form">'];

				if(nodeBarContents != null && nodeBarContents.length > 0){
					if(nodeBarContents[0] != null && nodeBarContents[0] != undefined && nodeBarContents[0].length > 0){
						var addNodeBarContents = nodeBarContents[0];
						// 1. æ£€æŸ¥æ˜¯å¦åŒ…å«äº†nowã€newlyã€btnè¿™ä¸‰ä¸ªé»˜è®¤é¡¹,å°†å…¶ä»–å…ƒç´ ä¾æ¬¡æŽ’åˆ—ï¼Œå°†ç‰¹æ®Šå…ƒç´ è‡³äºŽæ ˆé¡¶
						for(var i=0; i<addNodeBarContents.length; i++){
							var defElem = addNodeBarContents[i].defElem;
							if(defElem == "nowChoose") {
								$.extend(addNodeBarDef[0], addNodeBarContents[i]);
							} else if(defElem == "nowChange") {
								$.extend(addNodeBarDef[1], addNodeBarContents[i]);
							} else if(defElem == "btn") {
								$.extend(addNodeBarDef[2], addNodeBarContents[i]);
							} else {
								addNodeBarDef.push(addNodeBarContents[i]);
							}
						}
					}
				}

				// 2. éåŽ†ç”Ÿæˆå…¨éƒ¨è¡¨å•æ ‡ç­¾
				for(var j=0; j<addNodeBarDef.length; j++){
					var type = addNodeBarDef[j].type;
					if(!type){type = "text";}
					switch (type) {
						case "text":
							addNodeBar.push(_this.loadToolBarDetail(addNodeBarDef[j]).text());
							break;
						case "textarea":
							addNodeBar.push(_this.loadToolBarDetail(addNodeBarDef[j]).textarea());
							break;
						case "select":
							addNodeBar.push(_this.loadToolBarDetail(addNodeBarDef[j]).select());
							break;
						case "hidden":
							addNodeBar.push(_this.loadToolBarDetail(addNodeBarDef[j]).hidden());
							break;

					}
				}

				var addBtn = ['<div class="layui-form-item">', '<div class="layui-input-block" style="margin-left:0px;text-align:center;">'];
				// 3.éåŽ†ç”ŸæˆæŒ‰é’®
				for(var j=0; j<addNodeBarDef.length; j++){
					var type = addNodeBarDef[j].type;
					if(!type){type = "text";}
					switch (type) {
						case "submit":
							addBtn.push(_this.loadToolBarDetail(addNodeBarDef[j]).submit());
							break;
						case "button":
							addBtn.push(_this.loadToolBarDetail(addNodeBarDef[j]).button());
							break;
						case "reset":
							addBtn.push(_this.loadToolBarDetail(addNodeBarDef[j]).reset());
							break;

					}
				}
				addBtn.push('</div></div>');
				addNodeBar.push(addBtn.join(''));
				addNodeBar.push('</form></div>');
				html = addNodeBar.join('');
				break;

			case defaultTool.editTool:
				var editNodeBarDef = [{"label": "å½“å‰é€‰ä¸­", "name": "nodeTitle", "type": "text", "value": title, "defElem": "nowChoose", "readonly": true},
					{"label": "ç¼–è¾‘"+_this.toolbarStyle.title, "name": "editNodeName", "type": "text", "value": "", "defElem": "nowChange", "verify": "required"},
					{"type": "submit", "value": "ç¡®è®¤ç¼–è¾‘", "defElem": "btn", "filter": "dtree_editNode_" + _this.obj[0].id + "_form"}];

				var editNodeBar = ['<div class="'+TOOLBAR_TOOL+'"><form class="layui-form layui-form-pane" lay-filter="dtree_editNode_' + _this.obj[0].id + '_form">'];
				//2. ç”¨æˆ·è‡ªå®šä¹‰çš„èŠ‚ç‚¹å†…å®¹
				if(nodeBarContents != null && nodeBarContents.length > 0){

					if(nodeBarContents[1] != null && nodeBarContents[1] != undefined && nodeBarContents[1].length > 0){
						var editNodeBarContents = nodeBarContents[1];
						// 1. æ£€æŸ¥æ˜¯å¦åŒ…å«äº†nowã€newlyã€btnè¿™ä¸‰ä¸ªé»˜è®¤é¡¹,å°†å…¶ä»–å…ƒç´ ä¾æ¬¡æŽ’åˆ—ï¼Œå°†ç‰¹æ®Šå…ƒç´ è‡³äºŽæ ˆé¡¶
						for(var i=0; i<editNodeBarContents.length; i++){
							var defElem = editNodeBarContents[i].defElem;
							if(defElem == "nowChoose") {
								$.extend(editNodeBarDef[0], editNodeBarContents[i]);
							} else if(defElem == "nowChange") {
								$.extend(editNodeBarDef[1], editNodeBarContents[i]);
							} else if(defElem == "btn") {
								$.extend(editNodeBarDef[2], editNodeBarContents[i]);
							} else {
								editNodeBarDef.push(editNodeBarContents[i]);
							}
						}

					}
				}
				// 2. éåŽ†ç”Ÿæˆå…¨éƒ¨è¡¨å•æ ‡ç­¾
				for(var j=0; j<editNodeBarDef.length; j++){
					var type = editNodeBarDef[j].type;
					if(!type){type = "text";}
					switch (type) {
						case "text":
							editNodeBar.push(_this.loadToolBarDetail(editNodeBarDef[j]).text());
							break;
						case "textarea":
							editNodeBar.push(_this.loadToolBarDetail(editNodeBarDef[j]).textarea());
							break;
						case "select":
							editNodeBar.push(_this.loadToolBarDetail(editNodeBarDef[j]).select());
							break;
						case "hidden":
							editNodeBar.push(_this.loadToolBarDetail(editNodeBarDef[j]).hidden());
							break;
					}
				}

				var editBtn = ['<div class="layui-form-item">', '<div class="layui-input-block" style="margin-left:0px;text-align:center;">'];
				// 3.éåŽ†ç”ŸæˆæŒ‰é’®
				for(var j=0; j<editNodeBarDef.length; j++){
					var type = editNodeBarDef[j].type;
					if(!type){type = "text";}
					switch (type) {
						case "submit":
							editBtn.push(_this.loadToolBarDetail(editNodeBarDef[j]).submit());
							break;
						case "button":
							editBtn.push(_this.loadToolBarDetail(editNodeBarDef[j]).button());
							break;
						case "reset":
							editBtn.push(_this.loadToolBarDetail(editNodeBarDef[j]).reset());
							break;

					}
				}
				editBtn.push('</div></div>');
				editNodeBar.push(editBtn.join(''));
				editNodeBar.push('</form></div>');
				html = editNodeBar.join('');
				break;
		}
		return html;
	};

	/**
	 * @Desc: èŽ·å–toolbarè¯¦ç»†çš„æ ‡ç­¾ä¿¡æ¯
	 * @Param: nodeBarContents: å·¥å…·æ ä¸­çš„æ•°æ®æ¸²æŸ“å†…å®¹JSONå¯¹è±¡
	 */
	DTree.prototype.loadToolBarDetail = function(nodeBarContents){
		var _this = this;
		var readonly = (typeof (nodeBarContents.readonly) === "boolean") ? nodeBarContents.readonly : false;
		var disabled = (typeof (nodeBarContents.disabled) === "boolean") ? nodeBarContents.disabled : false;
		var id = nodeBarContents.id ? nodeBarContents.id : "";
		var name = nodeBarContents.name ? nodeBarContents.name : "";
		var val = nodeBarContents.value ? nodeBarContents.value : "";
		var verify = nodeBarContents.verify ? nodeBarContents.verify : "";
		var placeholder = nodeBarContents.placeholder ? nodeBarContents.placeholder : val;
		return{
			text: function(){
				return ['<div class="layui-form-item">',
					'<label class="layui-form-label" title="'+nodeBarContents.label+'">'+nodeBarContents.label+'ï¼š</label>',
					'<div class="layui-input-block f-input-par">',
					'<input type="text" class="layui-input f-input" value="'+val+'" placeholder="'+placeholder+'" lay-verify="'+verify+'" ',
					(id != "" ? 'id="'+id+'" ' : ''),
					(name != "" ? 'name="'+name+'" ' : ''),
					(readonly ? 'readonly ' : ''),
					(disabled ? 'disabled ' : ''),
					'/>',
					'</div>',
					'</div>'].join('');
			},
			textarea: function(){
				return ['<div class="layui-form-item layui-form-text">',
					'<label class="layui-form-label" title="'+nodeBarContents.label+'">'+nodeBarContents.label+'ï¼š</label>',
					'<div class="layui-input-block f-input-par">',
					'<textarea class="layui-textarea f-input" value="'+val+'" placeholder="'+placeholder+'" lay-verify="'+verify+'" ',
					(id != "" ? 'id="'+id+'" ' : ''),
					(name != "" ? 'name="'+name+'" ' : ''),
					(readonly ? 'readonly ' : ''),
					(disabled ? 'disabled ' : ''),
					'>'+val+'</textarea>',
					'</div>',
					'</div>'].join('');
			},
			hidden: function(){
				return ['<input type="hidden" class="layui-input f-input" value="'+val+'" lay-verify="'+verify+'" ',
					(id != "" ? 'id="'+id+'" ' : ''),
					(name != "" ? 'name="'+name+'" ' : ''),
					(readonly ? 'readonly ' : ''),
					(disabled ? 'disabled ' : ''),
					'/>'].join('');
			},
			select: function(){
				var optionsData = (typeof nodeBarContents.optionsData === 'object') ? nodeBarContents.optionsData : nodeBarContents.optionsData();
				var options = "";
				for(var key in optionsData){
					if(val == optionsData[key]){
						options += "<option value='"+key+"' selected>"+optionsData[key]+"</option>";
					} else {
						options += "<option value='"+key+"'>"+optionsData[key]+"</option>";
					}
				}
				return ['<div class="layui-form-item">',
					'<label class="layui-form-label" title="'+nodeBarContents.label+'">'+nodeBarContents.label+'ï¼š</label>',
					'<div class="layui-input-block f-input-par">',
					'<select lay-verify="'+verify+'" ',
					(id != "" ? 'id="'+id+'" ' : ''),
					(name != "" ? 'name="'+name+'" ' : ''),
					(readonly ? 'readonly ' : ''),
					(disabled ? 'disabled ' : ''),
					'>',
					options,
					'</select>', '</div>', '</div>'].join('');
			},
			submit: function(){
				var filter = nodeBarContents.filter;
				return ['<button type="button" class="layui-btn layui-btn-normal btn-w100" lay-submit lay-filter="'+filter+'" ',
					(id != "" ? 'id="'+id+'" ' : ''),
					(name != "" ? 'name="'+name+'" ' : ''),
					'>'+val+'</button>'].join('');
			},
			button: function(){
				return ['<button type="button" class="layui-btn layui-btn-normal btn-w100" ',
					(id != "" ? 'id="'+id+'" ' : ''),
					(name != "" ? 'name="'+name+'" ' : ''),
					' >'+val+'</button>'].join('');
			},
			reset: function(){
				return ['<button type="reset" class="layui-btn layui-btn-primary btn-w100" ',
					(id != "" ? 'id="'+id+'" ' : ''),
					(name != "" ? 'name="'+name+'" ' : ''),
					'>'+val+'</button>'].join('');
			}
		}
	};

	/**
	 * @Desc: æ–°å¢žèŠ‚ç‚¹åŽæ”¹å˜èŠ‚ç‚¹å†…å®¹
	 * @Param: returnID: å½“å‰éœ€è¦åŠ è½½çš„å†…å®¹ï¼ŒJSONå¯¹è±¡ã€å­—ç¬¦ä¸²ã€æŒ‡å®šå­—ç¬¦ä¸²ï¼ˆ"refresh"ï¼‰ã€true
	 */
	DTree.prototype.changeTreeNodeAdd = function(returnID){
		var _this = this;
		var temp = _this.temp;
		var id = temp[0], $ul = temp[1], $div = temp[2], level = temp[3];
		var flag = false;
		if(returnID){
			var $thisDiv = _this.obj.find("[data-id='"+id+"']");
			if(typeof returnID === "object"){
				// å¦‚æžœæ˜¯JSONæ ¼å¼æ•°æ®ï¼Œåˆ™å°†å½“å‰DIVåˆ é™¤ï¼Œé‡æ–°å»ºé€ DIV
				$thisDiv.remove();
				var parseData = _this.parseData(returnID);

				if(parseData.treeId()){
					$ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.fmtTitle(), parseData.last(0), parseData.ficonClass(), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(), parseData.disabled(), parseData.hide(), parseData.basicData(), parseData.recordData(), "item"));

					// å»ºé€ å®Œæ¯•åŽï¼Œé€‰ä¸­è¯¥DIV
					$thisDiv = $ul.find("div[data-id='"+parseData.treeId()+"']");
					_this.setNodeParam($thisDiv)
				} else {
					layer.msg("æ·»åŠ å¤±è´¥,èŠ‚ç‚¹IDä¸ºundefinedï¼",{icon:5});
					// å°†lièŠ‚ç‚¹åˆ é™¤
					$ul.find("li[data-id='"+id+"']").remove();
					// é‡æ–°èµ‹å€¼
					_this.setNodeParam($div);
					// ä¸´æ—¶å˜é‡åˆ¶ç©º
					_this.temp = [];
					return ;
				}
			}else if(returnID == 'refresh' || returnID == true){
				// å¦‚æžœæ˜¯è®¾ç½®ä¸ºrefreshå‚æ•°ï¼Œåˆ™å‘åŽå°å‘é€è¯·æ±‚ï¼ŒèŽ·å–æ–°å¢žèŠ‚ç‚¹ä¸‹çš„çœŸå®žå‚æ•°ï¼Œå±€éƒ¨åˆ·æ–°æ ‘ã€‚
				flag = true;
			} else if(typeof returnID === "string" || typeof returnID === 'number'){
				$thisDiv.attr("data-id", returnID);
				// å°†lièŠ‚ç‚¹å±•ç¤º
				$ul.find("li[data-id='"+returnID+"']").show();
				_this.setNodeParam($thisDiv)
			}

			// åˆ¤æ–­å½“å‰ç‚¹å‡»çš„èŠ‚ç‚¹æ˜¯å¦æ˜¯æœ€åŽä¸€çº§èŠ‚ç‚¹ï¼Œå¦‚æžœæ˜¯ï¼Œåˆ™éœ€è¦ä¿®æ”¹èŠ‚ç‚¹çš„æ ·å¼
			var $icon_i = $div.find("i[data-spread]");
			if ($icon_i.eq(0).attr("data-spread") == "last") {
				_this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).openWithLeaf();
			} else {	//å¦‚æžœä¸æ˜¯ï¼Œä¹Ÿè¦ä¿®æ”¹èŠ‚ç‚¹æ ·å¼
				_this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).open();
			}
			$ul.addClass(NAV_SHOW);	//å±•å¼€UL
			_this.accordionUL($ul);
			if(flag) {
				_this.getChild($div);
			} else {
				//		_this.showLine();
				_this.showLine($ul.find("li"));
				// è¿™ç§æƒ…å†µä¸‹éœ€è¦åœ¨æ–°å¢žèŠ‚ç‚¹åŽå¯¹èŠ‚ç‚¹æ–°å¢žå·¥å…·æ 
				if(_this.toolbar && _this.toolbarWay != 'contextmenu') {
					_this.dynamicToolbarDom($thisDiv.find("cite[data-leaf]"));
				}
			}

		} else {
			// å°†lièŠ‚ç‚¹åˆ é™¤
			$ul.find("li[data-id='"+id+"']").remove();
			// é‡æ–°èµ‹å€¼
			_this.setNodeParam($div);
		}

		_this.temp = []; // ä¸´æ—¶å˜é‡åˆ¶ç©º

	};

	/**
	 * @Desc: ç¼–è¾‘é¡µæ‰“å¼€åŽæ˜¾ç¤ºç¼–è¾‘é¡µå†…å®¹
	 * @Param: param: ç¼–è¾‘é¡µæ‰“å¼€ä¹‹åŽå›žæ˜¾çš„æ•°æ®é›†
	 */
	DTree.prototype.changeTreeNodeDone = function(param){
		var _this = this;
		form.val('dtree_editNode_' + _this.obj[0].id + '_form', param);
		form.render();
	};

	/**
	 * @Desc: ä¿®æ”¹èŠ‚ç‚¹åŽæ”¹å˜èŠ‚ç‚¹å†…å®¹
	 * @Param: returnID: å½“å‰éœ€è¦å˜æ›´çš„å†…å®¹ï¼ŒJSONå¯¹è±¡
	 */
	DTree.prototype.changeTreeNodeEdit = function(returnID){
		var _this = this;
		var temp = _this.temp;
		var $cite = temp[0], $div = temp[1], title = temp[2], $p_div = temp[3];
		var flag = false;
		if(returnID){
			if(typeof returnID === "object"){
				var parseData = _this.parseData(returnID);

				if(parseData.treeId()){
					var replaceDom = _this.replaceDom($div, parseData.treeId(), parseData.last(0), parseData.spread(), parseData.disabled(), parseData.hide());
					replaceDom.node(parseData.iconClass());
					replaceDom.checkbox(parseData.checkArr());
					replaceDom.text(parseData.title(),parseData.fmtTitle());
					replaceDom.ul();
					replaceDom.basicData(parseData.basicData());
					replaceDom.recordData(parseData.recordData());
					_this.setNodeParam($div);
				} else {
					layer.msg("ç¼–è¾‘å¤±è´¥,èŠ‚ç‚¹IDä¸ºundefinedï¼",{icon:5});
					// é‡æ–°èµ‹å€¼
					_this.setNodeParam($div);
				}
			}
		} else {
			$cite.html(title);
			_this.getNodeParam($div);
		}

		_this.temp = []; // ä¸´æ—¶å˜é‡åˆ¶ç©º
	};

	/**
	 * @Desc: åˆ é™¤èŠ‚ç‚¹åŽæ”¹å˜èŠ‚ç‚¹å†…å®¹
	 * @Param: flag: æ˜¯å¦è¦åˆ é™¤èŠ‚ç‚¹
	 */
	DTree.prototype.changeTreeNodeDel = function(flag){
		var _this = this;
		var temp = _this.temp;
		var $p_li = temp[0],
			$p_ul = $p_li.parent("ul"),
			$p_div = temp[1];

		if(flag){
			$p_li.remove();
			_this.showLine($p_ul.find("li"));
			// åˆ¤æ–­çˆ¶çº§ulä¸­æ˜¯å¦è¿˜å­˜åœ¨li,å¦‚æžœä¸å­˜åœ¨ï¼Œåˆ™éœ€è¦ä¿®æ”¹èŠ‚ç‚¹çš„æ ·å¼
			if($p_ul.children("li").length == 0){
				var $icon_i = $p_div.find("i[data-spread]");
				_this.operateIcon($icon_i.eq(0), $icon_i.eq(1)).closeWithLeaf();
			}
			_this.initNodeParam();
		}

		_this.temp = []; // ä¸´æ—¶å˜é‡åˆ¶ç©º
	};

	/******************** iframeåŒºåŸŸ ********************/
	/**
	 * @Desc: åŠ è½½iframe
	 * @Param: $div: JQueryå¯¹è±¡ï¼Œè¡¨ç¤ºå½“å‰èŠ‚ç‚¹
	 * @Param: iframeParam: iframeåŠ è½½çš„å‚æ•°
	 */
	DTree.prototype.loadIframe = function($div, iframeParam) {
		var _this = this;
		var $cite = _this.getNodeDom($div).cite();
		if (!_this.useIframe) {		// å¯ç”¨iframe
			return false;
		}
		var iframeElem = _this.iframeElem,
			iframeUrl = _this.iframeUrl,
			iframeLoad = _this.iframeLoad;

		var flag = iframeLoad == "leaf" ? (($cite.attr("data-leaf") == "leaf") ? true : false) : true;

		if (flag) {
			if ($(iframeElem).length > 0) {		//iframeå­˜åœ¨
				if (!iframeUrl) {
					layer.msg("æ•°æ®è¯·æ±‚å¼‚å¸¸ï¼ŒiframeUrlå‚æ•°æœªæŒ‡å®š", {icon:5});
					return false;
				}
				var param = AjaxHelper.serialize("?", iframeParam);
				if(iframeUrl.indexOf("?")> -1){
					param = "&"+param.substring(1, param.length);
				}
				var url = iframeUrl + param;
				$(iframeElem).attr("src", url);
			} else {
				layer.msg("iframeç»‘å®šå¼‚å¸¸ï¼Œè¯·ç¡®è®¤é¡µé¢ä¸­æ˜¯å¦æœ‰iframeé¡µå¯¹åº”çš„å®¹å™¨", {icon:5});
				return false;
			}
		}
		return flag;
	};

	/**
	 * @Desc: èŽ·å–ä¼ é€’å‡ºåŽ»çš„å‚æ•°ï¼Œæ ¹æ®iframe.iframeDefaultRequestã€iframe.iframeRequestå’Œnodeæ‹¼å‡ºå‘å‡ºè¯·æ±‚çš„å‚æ•°
	 * @Param: nodes: éœ€è¦ä¼ é€’å‡ºåŽ»çš„å‚æ•°
	 */
	DTree.prototype.getIframeRequestParam = function(nodes){
		var _this = this;
		var request = _this.iframeRequest,
			defaultRequestNames = _this.iframeDefaultRequest,
			node = nodes || _this.node,
			requestParam = {};

		// å…ˆæ‹¼ç”¨æˆ·è‡ªå®šä¹‰çš„ï¼Œåœ¨æ‹¼æ ‘ç”Ÿæˆçš„ï¼Œè¿™æ ·çš„è¯ç”¨æˆ·å¯ä»¥è‡ªå®šä¹‰å½“æ ‘æœªç”Ÿæˆæ—¶çš„èŠ‚ç‚¹çš„åˆå§‹å€¼
		for ( var key in request) {
			requestParam[key] = request[key];
		}
		for ( var key in defaultRequestNames) {
			var paramName = defaultRequestNames[key];
			var paramValue = node[key];
			if(typeof paramValue === "boolean"){
				requestParam[paramName] = paramValue;
			}else {
				if(paramValue){
					requestParam[paramName] = paramValue;
				}
			}
		}

		// è§£å†³ä¼ é€’ä¸­æ–‡çš„ä¹±ç é—®é¢˜
		var reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/;	//æ­£åˆ™åŒ¹é…ä¸­æ–‡
		for(var key in requestParam){
			if(reg.test(requestParam[key])) {
				var str = requestParam[key];
				requestParam[key] = encodeURI(encodeURI(str));
			}
		}

		return requestParam;
	};

	/******************** æ•°æ®å›žè°ƒåŒºåŸŸ ********************/
	/**
	 * @Desc: æ ¹æ®å…·ä½“çš„idèŽ·å–åŸºäºŽå½“å‰idçš„divä»¥åŠå¯¹åº”çš„å…¶ä»–domå…ƒç´
	 * @Param: id: èŠ‚ç‚¹çš„IDå€¼
	 */
	DTree.prototype.getNodeDom = function(id){
		var _this = this;
		// èŽ·å–å½“å‰divï¼Œå¦‚æžœidå°±æ˜¯ä¸€ä¸ªdomï¼Œåˆ™å°±æ˜¯è¿™ä¸ªï¼Œå¦‚æžœä¸æ˜¯åˆ™è¿›è¡Œé€‰æ‹©ã€‚å¦‚æžœé€‰ä¸ä¸­åˆ™ä¸ºnull
		var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']");
		return {
			div: function(){	// èŽ·å–å½“å‰div
				return $div;
			},
			fnode: function(){	// èŽ·å–ä¸€çº§å›¾æ ‡å…ƒç´
				return ($div == null) ? null : $div.find("i[data-spread]").eq(0);
			},
			snode: function(){	// èŽ·å–äºŒçº§å›¾æ ‡å…ƒç´
				return ($div == null) ? null : $div.find("i[data-spread]").eq(1);
			},
			checkbox: function(){		// èŽ·å–å¤é€‰æ¡†å…ƒç´
				return ($div == null) ? null : $div.find("i[data-par]");
			},
			cite: function(){	// èŽ·å–citeå…ƒç´
				return ($div == null) ? null : $div.find("cite[data-leaf]");
			},
			nextUl: function(){	// èŽ·å–ç›¸é‚»çš„ulå…ƒç´
				return ($div == null) ? null : $div.next("ul");
			},
			parentLi: function(){	// èŽ·å–çˆ¶çº§liå…ƒç´
				return ($div == null) ? null : $div.parent("li");
			},
			parentUl: function(){	// èŽ·å–åŸºäºŽå½“å‰$divçš„ä¸Šçº§$ul
				return ($div == null) ? null : $div.parent("li").parent("ul");
			},
			parentDiv: function(){  // èŽ·å–åŸºäºŽå½“å‰$divçš„ä¸Šçº§$div
				return ($div == null) ? null : $div.parent("li").parent("ul").prev("div");
			},
			nowDiv: function(){		// èŽ·å–å½“å‰é€‰ä¸­èŠ‚ç‚¹ï¼Œæ²¡æœ‰åˆ™è¿”å›žnull
				return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS);
			},
			nowOrRootDiv: function(){	// èŽ·å–å½“å‰é€‰ä¸­èŠ‚ç‚¹ï¼Œæ²¡æœ‰åˆ™è¿”å›žæ ¹èŠ‚ç‚¹ä¸‹çš„ç¬¬ä¸€ä¸ªdiv
				return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj.children("li").eq(0).children("div").eq(0) : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS);
			},
			nowOrRootUl: function(){	// èŽ·å–å½“å‰é€‰ä¸­èŠ‚ç‚¹ä¸‹ä¸€ä¸ªUL æˆ–æ ¹èŠ‚ç‚¹ã€‚ä¸ºäº†å°†æ–°èŠ‚ç‚¹æ”¾å…¥ulä¸‹
				return (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id]").parent().find("."+NAV_THIS).next("ul");
			}
		}
	};

	/**
	 * @Desc: èŽ·å–å½“å‰é€‰ä¸­èŠ‚ç‚¹ä¸‹ä¸€ä¸ªulèŠ‚ç‚¹ æˆ–æ ¹èŠ‚ç‚¹ã€‚ä¸ºäº†å°†æ–°èŠ‚ç‚¹æ”¾å…¥ulä¸‹
	 */
	DTree.prototype.getNowNodeUl =  function() {
		var _this = this;
		return _this.getNodeDom().nowOrRootUl();
	};

	/**
	 * @Desc: èŽ·å–å½“å‰é€‰ä¸­divèŠ‚ç‚¹ æˆ–ç¬¬ä¸€ä¸ªæ ¹divèŠ‚ç‚¹ã€‚
	 */
	DTree.prototype.getNowNode =  function() {
		var _this = this;
		return _this.getNodeDom().nowOrRootDiv();
	};

	/**
	 * @Desc: èŽ·å–å½“å‰é€‰ä¸­divèŠ‚ç‚¹ æ— åˆ™è¿”å›žnullã€‚
	 */
	DTree.prototype.getNowNodeOrNull =  function() {
		var _this = this;
		return _this.getNodeDom().nowDiv();
	};

	/**
	 * @Desc: æ ¹æ®èŽ·å–æŒ‡å®šdivèŠ‚ç‚¹ã€‚
	 * @Param: idï¼š æŒ‡å®šèŠ‚ç‚¹çš„ID
	 */
	DTree.prototype.getNode =  function(id) {
		var _this = this;
		return _this.getNodeDom(id).div();
	};

	/**
	 * @Desc: è®¾ç½®å½“å‰é€‰ä¸­èŠ‚ç‚¹çš„å…¨éƒ¨å‚æ•°
	 * @Param: $divï¼š å½“å‰é€‰ä¸­çš„èŠ‚ç‚¹
	 */
	DTree.prototype.setNodeParam = function($div) {
		var _this = this;
		_this.node.nodeId = $div.attr("data-id");
		_this.node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid");
		_this.node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text();
		_this.node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false;
		_this.node.level = _this.getNodeDom($div).parentLi().attr("data-index");
		_this.node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false;

		var basicData = $div.attr("data-basic");
		if(basicData) {
			basicData = JSON.parse(event.unescape(basicData));
		}
		_this.node.basicData = basicData;

		var recordData = $div.attr("data-record");
		if(recordData) {
			recordData = JSON.parse(event.unescape(recordData));
		}
		_this.node.recordData = recordData;

		if (_this.getNodeDom($div).checkbox()) {
			var dataTypes = "", checkeds = "", initcheckeds = "";
			_this.getNodeDom($div).checkbox().each(function(){
				dataTypes += $(this).attr("data-type") + ",";
				checkeds += $(this).attr("data-checked") + ",";
				initcheckeds += $(this).attr("data-initchecked") + ",";
			});
			dataTypes = dataTypes.substring(0, dataTypes.length-1);
			checkeds = checkeds.substring(0, checkeds.length-1);
			initcheckeds = initcheckeds.substring(0, initcheckeds.length-1);

			_this.node.dataType = dataTypes;
			_this.node.checked = checkeds;
			_this.node.initchecked = initcheckeds;
		}
	};

	/**
	 * @Desc: èŽ·å–å½“å‰é€‰ä¸­èŠ‚ç‚¹çš„å…¨éƒ¨å‚æ•°
	 * @Param: $divï¼š å½“å‰é€‰ä¸­çš„èŠ‚ç‚¹
	 */
	DTree.prototype.getNodeParam = function($div) {
		var _this = this;
		if ($div) {
			_this.setNodeParam($div);
		} else {
			if(_this.obj.find("div[data-id]").parent().find("."+NAV_THIS).length == 0){
				_this.initNodeParam();
			}
		}
		return this.node;
	};

	/**
	 * @Desc: èŽ·å–ä¸€ä¸ªä¸´æ—¶çš„nodeå‚æ•°
	 * @Param: $divï¼š å½“å‰é€‰ä¸­çš„èŠ‚ç‚¹
	 */
	DTree.prototype.getTempNodeParam = function($div) {
		var _this = this;
		var temp_node = {};
		temp_node.nodeId = $div.attr("data-id");
		temp_node.parentId = _this.getNodeDom($div).parentLi().attr("data-pid");
		temp_node.context = (typeof _this.formatter.title === 'function') ? _this.getNodeDom($div).cite().attr("data-title") : _this.getNodeDom($div).cite().text();
		temp_node.leaf = _this.getNodeDom($div).cite().attr("data-leaf") == "leaf" ? true : false;
		temp_node.level = _this.getNodeDom($div).parentLi().attr("data-index");
		temp_node.spread = _this.getNodeDom($div).fnode().attr("data-spread") == "open" ? true : false;

		var basicData = $div.attr("data-basic");
		if(basicData) {
			basicData = JSON.parse(event.unescape(basicData));
		}
		temp_node.basicData = basicData;
		var recordData = $div.attr("data-record");
		if(recordData) {
			recordData = JSON.parse(event.unescape(recordData));
		}
		temp_node.recordData = recordData;

		if (_this.getNodeDom($div).checkbox()) {
			var dataTypes = "", checkeds = "", initcheckeds = "";
			_this.getNodeDom($div).checkbox().each(function(){
				dataTypes += $(this).attr("data-type") + ",";
				checkeds += $(this).attr("data-checked") + ",";
				initcheckeds += $(this).attr("data-initchecked") + ",";
			});
			dataTypes = dataTypes.substring(0, dataTypes.length-1);
			checkeds = checkeds.substring(0, checkeds.length-1);
			initcheckeds = initcheckeds.substring(0, initcheckeds.length-1);

			temp_node.dataType = dataTypes;
			temp_node.checked = checkeds;
			temp_node.initchecked = initcheckeds;
		}
		return temp_node;
	};

	/**
	 * @Desc: é‡ç½®å†…ç½®å‚æ•°
	 */
	DTree.prototype.initNodeParam = function(){
		var _this = this;
		_this.node.nodeId = "";
		_this.node.parentId = "";
		_this.node.context = "";
		_this.node.leaf = "";
		_this.node.level = "";
		_this.node.spread = "";
		_this.node.dataType = "";
		_this.node.checked = "";
		_this.node.initchecked = "";
		_this.node.basicData = "";
		_this.node.recordData = "";

		if(_this.select) {
			_this.selectResetVal();
		}
	};

	/**
	 * @Desc: èŽ·å–ä¼ é€’å‡ºåŽ»çš„å‚æ•°ï¼Œæ ¹æ®defaultRequestã€requestå’Œnodeæ‹¼å‡ºå‘å‡ºè¯·æ±‚çš„å‚æ•°
	 * @Param: nodesï¼šéœ€è¦ä¼ é€’å‡ºåŽ»çš„å‚æ•°
	 */
	DTree.prototype.getRequestParam = function(nodes){
		var _this = this;
		var request = _this.request,
			defaultRequestNames = _this.defaultRequest,
			node = nodes || _this.node,
			requestParam = {};

		// å…ˆæ‹¼ç”¨æˆ·è‡ªå®šä¹‰çš„ï¼Œåœ¨æ‹¼æ ‘ç”Ÿæˆçš„ï¼Œè¿™æ ·çš„è¯ç”¨æˆ·å¯ä»¥è‡ªå®šä¹‰å½“æ ‘æœªç”Ÿæˆæ—¶çš„èŠ‚ç‚¹çš„åˆå§‹å€¼
		for ( var key in request) {
			requestParam[key] = request[key];
		}
		for ( var key in defaultRequestNames) {
			var paramName = defaultRequestNames[key];
			var paramValue = node[key];
			if(typeof paramValue === "boolean"){
				requestParam[paramName] = paramValue;
			}else {
				if(paramValue){
					requestParam[paramName] = paramValue;
				}
			}

		}
		return requestParam;
	};

	/**
	 * @Desc:  èŽ·å–filterParamè¿‡æ»¤åŽçš„requestParam
	 * @Param: requestParamï¼šè¯·æ±‚å‚æ•°
	 */
	DTree.prototype.getFilterRequestParam = function(requestParam){
		var _this = this;
		var filterRequest = _this.filterRequest;
		return event.cloneObj(requestParam, filterRequest);
	};

	/**
	 * @Desc:  èŽ·å–å½“å‰é€‰ä¸­çš„è¯·æ±‚å‚æ•°
	 */
	DTree.prototype.getNowParam = function(){
		var _this = this;

		return _this.getRequestParam(_this.getNodeParam());
	};

	/**
	 * @Desc:  æ ¹æ®idèŽ·å–æŒ‡å®šdivèŠ‚ç‚¹é€‰ä¸­å‚æ•°
	 * @Param: idï¼šèŠ‚ç‚¹çš„IDå€¼
	 */
	DTree.prototype.getParam = function(id){
		var _this = this;

		// èŽ·å–å½“å‰divï¼Œå¦‚æžœidå°±æ˜¯ä¸€ä¸ªdomï¼Œåˆ™å°±æ˜¯è¿™ä¸ªï¼Œå¦‚æžœä¸æ˜¯åˆ™è¿›è¡Œé€‰æ‹©ã€‚å¦‚æžœé€‰ä¸ä¸­åˆ™ä¸ºnull
		var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']");
		if($div != null){ return _this.callbackData().node(_this.getTempNodeParam($div)); } else { return {}; }
	};

	/**
	 * @Desc:  æ ¹æ®idèŽ·å–èŠ‚ç‚¹ä¸Šçº§èŠ‚ç‚¹å‚æ•°
	 * @Param: idï¼šèŠ‚ç‚¹çš„IDå€¼
	 */
	DTree.prototype.getParentParam = function(id){
		var _this = this;
		// èŽ·å–å½“å‰divï¼Œå¦‚æžœidå°±æ˜¯ä¸€ä¸ªdomï¼Œåˆ™å°±æ˜¯è¿™ä¸ªï¼Œå¦‚æžœä¸æ˜¯åˆ™è¿›è¡Œé€‰æ‹©ã€‚å¦‚æžœé€‰ä¸ä¸­åˆ™ä¸ºnull
		var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']");
		if($div != null){ return _this.callbackData().parentNode($div); } else { return {}; }
	};

	/**
	 * @Desc:  æ ¹æ®idèŽ·å–èŠ‚ç‚¹çš„å…¨éƒ¨ä¸Šçº§èŠ‚ç‚¹å‚æ•°å€¼
	 * @Param: idï¼šèŠ‚ç‚¹çš„IDå€¼
	 */
	DTree.prototype.getAllParentParam = function(id){
		var _this = this;
		// èŽ·å–å½“å‰divï¼Œå¦‚æžœidå°±æ˜¯ä¸€ä¸ªdomï¼Œåˆ™å°±æ˜¯è¿™ä¸ªï¼Œå¦‚æžœä¸æ˜¯åˆ™è¿›è¡Œé€‰æ‹©ã€‚å¦‚æžœé€‰ä¸ä¸­åˆ™ä¸ºnull
		var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']");
		var arr = [];
		if($div != null){
			var level = _this.getTempNodeParam($div).level;
			for(var i=1; i<level; i++){  // ä»Ž1å¼€å§‹éåŽ†ï¼Œå¦‚æžœlevelç­‰äºŽ1è¯´æ˜Žæ˜¯æ ¹èŠ‚ç‚¹
				arr.unshift(_this.callbackData().parentNode($div));
				$div = _this.getNodeDom($div).parentDiv();
			}
		}
		return arr;
	};

	/**
	 * @Desc:  æ ¹æ®idèŽ·å–èŠ‚ç‚¹çš„ä¸‹çº§èŠ‚ç‚¹
	 * @Param: idï¼šèŠ‚ç‚¹çš„IDå€¼
	 */
	DTree.prototype.getChildParam = function(id){
		var _this = this;
		// èŽ·å–å½“å‰divï¼Œå¦‚æžœidå°±æ˜¯ä¸€ä¸ªdomï¼Œåˆ™å°±æ˜¯è¿™ä¸ªï¼Œå¦‚æžœä¸æ˜¯åˆ™è¿›è¡Œé€‰æ‹©ã€‚å¦‚æžœé€‰ä¸ä¸­åˆ™ä¸ºnull
		var $div = (typeof id === 'object') ? id : (_this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']").length == 0) ? null : _this.obj.find("div[dtree-click='"+eventName.itemNodeClick+"'][data-id='"+id+"']");
		if($div != null){ return _this.callbackData().childNode($div); } else { return []; }
	};

	/**
	 * @Desc: å‚æ•°èŽ·å–é›†
	 */
	DTree.prototype.callbackData = function(){
		var _this = this;
		return {
			dom: function($dom){  // èŽ·å–dom
				return $dom;
			},
			node: function(node){	// èŽ·å–å½“å‰èŠ‚ç‚¹å€¼
				return _this.getRequestParam(node);
			},
			childNode: function($div){	// èŽ·å–ä¸‹çº§èŠ‚ç‚¹å€¼
				var $childDivs = $div.next("ul").find("li."+LI_NAV_ITEM+" div."+LI_DIV_ITEM);
				var childNode = [];
				if($childDivs && $childDivs.length > 0){
					$childDivs.each(function(){
						var $cDiv = $(this);
						childNode.push(_this.getRequestParam(_this.getTempNodeParam($cDiv)));
					});
				}
				return childNode;
			},
			parentNode: function($div){	// èŽ·å–ä¸Šçº§èŠ‚ç‚¹å€¼
				var pId = _this.getNodeDom($div).parentLi().attr("data-pid");
				var $pdiv = _this.obj.find("div[data-id='"+pId+"']");
				if($pdiv.length > 0) {return _this.getRequestParam(_this.getTempNodeParam($pdiv));} else {return {};}

			}
		}
	};

	/******************** äº‹ä»¶å›žè°ƒåŒºåŸŸ ********************/
	/**
	 * @Desc: ç»‘å®šæµè§ˆå™¨äº‹ä»¶
	 */
	DTree.prototype.bindBrowserEvent = function(){
		var _this = this;
		var rootId = _this.obj[0].id;

		// ç»‘å®šæ–‡ä»¶å¤¹å±•å¼€/æ”¶ç¼©çš„å›¾æ ‡çš„ç‚¹å‡»äº‹ä»¶ï¼Œç‚¹å‡»æ—¶ç»™å½“å‰èŠ‚ç‚¹çš„divæ·»åŠ é€‰ä¸­class
		_this.obj.on("click", "i[data-spread]", function(event) {
			event.stopPropagation();
			var $i = $(this),
				$div = $i.parent("div"),
				node = _this.getNodeParam($div);

			_this.toolbarHide();
			_this.navThis($div);
			_this.clickSpread($div);	// å±•å¼€æˆ–éšè—èŠ‚ç‚¹

			// æ ‘çŠ¶æ€æ”¹å˜åŽï¼Œç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
			layui.event.call(this, MOD_NAME, "changeTree("+$(_this.obj)[0].id+")",  {
				dom: _this.callbackData().dom($i),
				param: _this.callbackData().node(node),
				show: _this.callbackData().dom($i).attr("data-spread") == "open" ? true : false
			});
		});

		// ç»‘å®šæ‰€æœ‰å­èŠ‚ç‚¹divçš„å•å‡»äº‹ä»¶ï¼Œç‚¹å‡»æ—¶è§¦å‘åŠ è½½iframeæˆ–ç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
		_this.obj.on("click", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event) {
			event.stopPropagation();
			var $div = $(this),
				$cite = $div.find("cite"),
				node = _this.getNodeParam($div);
			_this.toolbarHide();
			_this.navThis($div);

			if(_this.select) {
				_this.selectVal(node.nodeId);
				$("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").click();
			}

			if (_this.useIframe) {
				var iframeParam = _this.getFilterRequestParam(_this.getIframeRequestParam(node));
				var flag = _this.loadIframe($div, iframeParam);	// åŠ è½½iframe
				if (flag) {
					// iframeåŠ è½½å®Œæ¯•åŽï¼Œç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
					_this.iframeFun.iframeDone(iframeParam);

					layui.event.call(this, MOD_NAME, "iframeDone("+$(_this.obj)[0].id+")",  {
						"iframeParam": iframeParam,
						dom: _this.callbackData().dom($div)
					});
				}
			} else {
				// å•å‡»äº‹ä»¶æ‰§è¡Œå®Œæ¯•åŽï¼Œç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
				layui.event.call(this, MOD_NAME, "node("+$(_this.obj)[0].id+")", {
					param: _this.callbackData().node(node),
					childParams: _this.callbackData().childNode($div),
					parentParam: _this.callbackData().parentNode($div),
					dom: _this.callbackData().dom($div)
				});
			}
		});

		// ç»‘å®šæ‰€æœ‰å­èŠ‚ç‚¹divçš„åŒå‡»äº‹ä»¶ï¼Œæš´éœ²onç»™ç”¨æˆ·è‡ªå®šä¹‰
		_this.obj.on("dblclick", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event) {
			event.stopPropagation();
			var $div = $(this),
				$cite = $div.find("cite"),
				node = _this.getNodeParam($div);
			_this.toolbarHide();
			_this.navThis($div);

			if(_this.select) {
				_this.selectVal(node.nodeId);
				$("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").click();
			}

			// åŒå‡»äº‹ä»¶æ‰§è¡Œå®Œæ¯•åŽï¼Œç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
			layui.event.call(this, MOD_NAME, "nodedblclick("+$(_this.obj)[0].id+")",  {
				param: _this.callbackData().node(node),
				childParams: _this.callbackData().childNode($div),
				parentParam: _this.callbackData().parentNode($div),
				dom: _this.callbackData().dom($div)
			});
		});

		if(_this.checkbar) {
			// ç»‘å®šcheboxbarçš„èŠ‚ç‚¹å¤é€‰æ¡†
			_this.obj.on("click", "i[dtree-click='"+eventName.checkNodeClick+"'][dtree-disabled='false']", function(event) {
				_this.toolbarHide();
				var $i = $(this),
					$div = $i.closest("div[dtree-click='"+eventName.itemNodeClick+"']"),
					node = _this.getNodeParam($div);
				// å¤é€‰æ¡†é€‰ä¸­å‰çš„å›žè°ƒ
				var flag = _this.checkbarFun.chooseBefore($i, _this.getRequestParam(node));
				_this.temp = [$i];
				if(flag){_this.changeCheck();}

				event.stopPropagation();
			});
		}

		if(_this.menubar) {
			// ç»‘å®šmenubarçš„ç‚¹å‡»äº‹ä»¶
			_this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).on("click", "button[d-menu]", function(event) {
				event.stopPropagation();
				_this.toolbarHide();
				_this.menubarListener($(this).attr("d-menu"), "group");
			});

			// ç»‘å®šmenubarçš„ç‚¹å‡»äº‹ä»¶
			_this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[d-menu]", function(event) {
				event.stopPropagation();
				_this.toolbarHide();
				_this.menubarListener($(this).attr("d-menu"), "toolbar");
			});

			// ç»‘å®šmenubarçš„ç‚¹å‡»æŒ‰é’®äº‹ä»¶
			_this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").on("click", function(event) {
				event.stopPropagation();
				_this.toolbarHide();
				_this.menubarListener($(this).attr("dtree-menu"), "freedom");
			});
		}

		if(_this.toolbar) {
			if(_this.toolbarWay == "contextmenu") {
				//ç»‘å®šæ‰€æœ‰å­èŠ‚ç‚¹divçš„å³é”®ç‚¹å‡»äº‹ä»¶ï¼Œç”¨äºŽæ˜¾ç¤ºtoolbar
				_this.obj.on("contextmenu", "div[dtree-click='"+eventName.itemNodeClick+"'][d-contextmenu='true'][dtree-disabled='false']", function(e){
					var $div = $(this),
						node = _this.getNodeParam($div);

					_this.toolbarHide();
					// toolbaråŠ è½½å‰æ‰§è¡Œçš„æ–¹æ³•ï¼Œæ‰§è¡Œå®Œæ¯•ä¹‹åŽåˆ›å»ºæŒ‰é’®
					_this.setToolbarDom().setToolbarPlace(_this.toolbarFun.loadToolbarBefore(event.cloneObj(_this.toolbarMenu), _this.getRequestParam(node), $div));

					var e = e || window.event,
						mx = e.pageX - $div.offset().left +45 ,
						my = $div.offset().top - _this.obj.closest(_this.scroll).offset().top +15;

					_this.navThis($div);
					var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id);
					$toolBarDiv.find(".layui-nav-child").addClass('layui-anim-fadein layui-show');
					$toolBarDiv.css({'left':mx+'px','top':my+'px'});

					e.stopPropagation();
					return false;
				});

				// ç»‘å®šè£…è½½æ ‘çš„ä¸Šå±‚å‡ºçŽ°æ»šåŠ¨æ¡çš„å®¹å™¨ï¼Œè®©toolbaréšè—
				_this.obj.closest(_this.scroll).scroll(function() {
					_this.toolbarHide();
				});

				// ç»‘å®štoolbarçš„ç‚¹å‡»äº‹ä»¶
				_this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[dtree-tool]", function(event) {
					event.stopPropagation();
					var $div = _this.getNodeDom().nowOrRootDiv(),
						node = _this.getNodeParam($div);
					_this.toolbarHide();
					var tool = $(this).attr("dtree-tool");
					_this.toolbarListener(tool, $div);
				});
			} else if(_this.toolbarWay == "fixed") {
				// ç»‘å®štoolbarçš„ç‚¹å‡»äº‹ä»¶
				_this.obj.on("click", "a[dtree-tool]", function(event) {
					event.stopPropagation();
					var $a = $(this),
						$cite = $a.parent("em."+TOOLBAR_TOOL_EM).prev("cite"),	//å½“å‰é€‰ä¸­èŠ‚ç‚¹çš„text
						$div = $cite.parent("div"),
						node = _this.getNodeParam($div);
					var tool = $a.attr("dtree-tool");

					_this.toolbarHide();
					_this.navThis($div);
					_this.toolbarListener(tool, $div);
				});
			} else if(_this.toolbarWay == "follow") {
				//ç»‘å®šæ‰€æœ‰å­èŠ‚ç‚¹divçš„mouseover mouseoutäº‹ä»¶ï¼Œç”¨äºŽæ˜¾ç¤ºæˆ–éšè—toolbar
				_this.obj.on("mouseover mouseout", "div[dtree-click='"+eventName.itemNodeClick+"'][dtree-disabled='false']", function(event){
					var $div = $(this),
						$toolBarEm = $div.children("em."+TOOLBAR_TOOL_EM);
					if(event.type == "mouseover"){
						$toolBarEm.removeClass(NAV_HIDE);
						event.stopPropagation();
					} else if(event.type == "mouseout"){
						$toolBarEm.addClass(NAV_HIDE);
						event.stopPropagation();
					}
				});

				// ç»‘å®štoolbarçš„ç‚¹å‡»äº‹ä»¶
				_this.obj.on("click", "a[dtree-tool]", function(event) {
					event.stopPropagation();
					var $a = $(this),
						$cite = $a.parent("em."+TOOLBAR_TOOL_EM).prev("cite"),	//å½“å‰é€‰ä¸­èŠ‚ç‚¹çš„text
						$div = $cite.parent("div"),
						node = _this.getNodeParam($div);
					var tool = $a.attr("dtree-tool");

					_this.toolbarHide();
					_this.navThis($div);
					_this.toolbarListener(tool, $div);
				});
			}
		}

		if(_this.select) {
			// ç»‘å®šselectçš„ç‚¹å‡»äº‹ä»¶
			$("div[dtree-id='" + rootId + "'][dtree-select='"+_this.selectDiv+"']").on("click", function(event){
				event.stopPropagation();
				var dl = $(this).find('dl');
				//debugger;
				$(this).toggleClass("layui-form-selected");

				var $card = $("div[dtree-id='" + rootId + "'][dtree-card='"+_this.selectCardDiv+"']");

				$card.toggleClass("dtree-select-show layui-anim layui-anim-upbit");
				var top = $(this).offset().top + $(this).outerHeight() - $WIN.scrollTop() - 5,
					cardHeight = $card.height(),
					winHeight = $WIN.height();
//                console.log("top =  $(this).offset().top: " + $(this).offset().top + " + $(this).outerHeight(): " + $(this).outerHeight() + " - $WIN.scrollTop(): " + $WIN.scrollTop() + " - 5 =" + top);
//                console.log("winHeight = " + winHeight);
				if($card.hasClass('dtree-select-up')) {
					$card.removeClass('dtree-select-up');
				}

				//ä¸Šä¸‹å®šä½è¯†åˆ«
				if(top + cardHeight > $WIN.height() && top >= cardHeight){
					console.log(" top + cardHeight : "+ top + " + " + cardHeight + " > $WIN.height() :" + $WIN.height() + " && top >= cardHeight :" + top + " > " + cardHeight);
					if($card.hasClass('dtree-select-up')) {
						$card.removeClass('dtree-select-up');
					} else {
						$card.addClass('dtree-select-up');
					}
				} else {
					$card.removeClass('dtree-select-up');
				}

				// ä¸‹æ‹‰æ ‘é¢æ¿å¼€é—­çŠ¶æ€æ”¹å˜åŽï¼Œç”¨æˆ·è‡ªå®šä¹‰æƒ³åšçš„äº‹æƒ…
				layui.event.call(this, MOD_NAME, "changeSelect("+$(_this.obj)[0].id+")",  {
					show: $(this).hasClass("layui-form-selected"),
					param: _this.selectVal()
				});
			});

		}
	};

	// ç»‘å®šbodyçš„å•å‡»ï¼Œè®©æœ¬é¡µé¢æ‰€æœ‰çš„toolbaréšè—
	$BODY.on("click", function(event){
		$("div."+LI_DIV_TOOLBAR).find(".layui-show").removeClass('layui-anim-fadein layui-show');
		// $("div[dtree-id][dtree-select]").removeClass("layui-form-selected");
		// $("div[dtree-id][dtree-card]").removeClass("dtree-select-show layui-anim layui-anim-upbit");

	});

	// è§£ç»‘æµè§ˆå™¨äº‹ä»¶
	DTree.prototype.unbindBrowserEvent = function(){
		var _this = this;

		// æœ¬èº«äº‹ä»¶è§£ç»‘
		_this.obj.unbind();
		// èœå•æ è§£ç»‘
		if(_this.menubar){
			_this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).unbind();
			if(_this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").length > 0){
				_this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").unbind();
			}
		}

		// å·¥å…·æ è§£ç»‘
		if(_this.toolbar){
			if(_this.toolbarWay == "contextmenu") {
				_this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).unbind();
				if(_this.obj.closest(_this.scroll).length > 0){
					_this.obj.closest(_this.scroll).unbind();
				}
			}
		}

		// ä¸‹æ‹‰æ ‘è§£ç»‘
		if(_this.select) {
			// è§£ç»‘selectçš„ç‚¹å‡»äº‹ä»¶
			$("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").removeClass("layui-form-selected");
			$("div[dtree-id='" + _this.obj[0].id + "'][dtree-card='"+_this.selectCardDiv+"']").removeClass("dtree-select-show layui-anim layui-anim-upbit");
			$("div[dtree-id='" + _this.obj[0].id + "'][dtree-select='"+_this.selectDiv+"']").unbind();
		}
	};


	/** å¤–éƒ¨è®¿é—® **/
	var dtree = {
		set: function(options){ //è®¾ç½®å…¨å±€å±žæ€§
			if(typeof options !== 'undefined') {
				$.extend(OPTIONS, options);
			}
		},
		render: function(options){	// åˆå§‹åŒ–æ ‘
			var dTree = null;
			var id = event.getElemId(options);
			if(id == "") {
				layer.msg("é¡µé¢ä¸­æœªæ‰¾åˆ°ç»‘å®šid", {icon:5});
			} else {
				dTree = DTrees[id];
				if(typeof dTree === 'object'){
					dTree.unbindBrowserEvent();
				}
				// åˆ›å»ºæ ‘
				dTree = new DTree(options);
				// æ·»åŠ åˆ°æ ‘æ•°ç»„ä¸­åŽ»
				DTrees[id] = dTree;
				dTree.initTreePlus();
				dTree.openTreePlus();
				dTree.loadTreeInit();
				dTree.bindBrowserEvent();
			}

			return dTree;
		},
		renderSelect: function(options){ 	// åˆå§‹åŒ–ä¸‹æ‹‰æ ‘
			var dTree = null;
			var id = event.getElemId(options);
			if(id == "") {
				layer.msg("é¡µé¢ä¸­æœªæ‰¾åˆ°ç»‘å®šid", {icon:5});
			} else {
				dTree = DTrees[id];
				if(typeof dTree === 'object'){
					dTree.unbindBrowserEvent();
				}
				// åˆ›å»ºä¸‹æ‹‰æ ‘
				dTree = new DTree(options);
				dTree.selectSetting();
				// æ·»åŠ åˆ°æ ‘æ•°ç»„ä¸­åŽ»
				DTrees[id] = dTree;
				dTree.initTreePlus();
				dTree.openTreePlus();
				dTree.loadTreeInit();
				dTree.bindBrowserEvent();
			}

			return dTree;
		},
		reload: function(dTree, options){  // é‡æ–°åŠ è½½æ ‘
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			dTree.reloadSetting(options);
			dTree.initTreePlus();
			dTree.openTreePlus();
			dTree.initNodeParam();
			dTree.loadTreeInit();
			dTree.unbindBrowserEvent();
			dTree.bindBrowserEvent();
		},
		on: function(events, callback) {	// ç»‘å®šäº‹ä»¶
			if(events.indexOf("'") > 0){
				events = events.replace(/'/g,"");
			}
			if(events.indexOf('"') > 0) {
				events = events.replace(/"/g,"");
			}
			return layui.onevent.call(this, MOD_NAME, events, callback);
		},
		click: function(dTree, id) { // æ¨¡æ‹Ÿå•å‡»äº‹ä»¶
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			$("div[dtree-click='"+eventName.itemNodeClick+"'][dtree-id='"+dTree.obj[0].id+"'][data-id='"+id+"']").click();
		},
		getNowParam: function(dTree){  // èŽ·å–å½“å‰é€‰ä¸­å€¼
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.getNowParam();	// èŽ·å–å½“å‰é€‰ä¸­å€¼
		},
		getParam: function(dTree, id){  // èŽ·å–æŒ‡å®šèŠ‚ç‚¹å€¼
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.getParam(id);	// èŽ·å–æŒ‡å®šèŠ‚ç‚¹å€¼
		},
		getParentParam: function(dTree, id){  // èŽ·å–å‚æ•°çš„ä¸Šçº§èŠ‚ç‚¹
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.getParentParam(id);
		},
		getAllParentParam: function(dTree, id){  // èŽ·å–å‚æ•°çš„å…¨éƒ¨ä¸Šçº§èŠ‚ç‚¹
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.getAllParentParam(id);
		},
		getChildParam: function(dTree, id){  // èŽ·å–å‚æ•°çš„å…¨éƒ¨ä¸‹çº§èŠ‚ç‚¹
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.getChildParam(id);
		},
		getCheckbarNodesParam: function(dTree){  // èŽ·å–å¤é€‰æ¡†é€‰ä¸­å€¼
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return {};
			}
			return dTree.getCheckbarNodesParam();	// èŽ·å–å¤é€‰æ¡†é€‰ä¸­å€¼
		},
		getCheckbarJsonArrParam: function(dTree){  // èŽ·å–å¤é€‰æ¡†é€‰ä¸­å€¼
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return {};
			}
			return dTree.getCheckbarJsonArrParam();	// èŽ·å–å¤é€‰æ¡†é€‰ä¸­å€¼
		},
		dataInit: function(dTree, chooseId){  // åˆå§‹åŒ–é€‰ä¸­æ ‘ï¼Œé’ˆå¯¹æ•°æ®åé€‰
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			if(chooseId){
				return dTree.dataInit(chooseId);
			}
		},
		chooseDataInit: function(dTree, chooseIds){	// åˆå§‹åŒ–å¤é€‰æ¡†é€‰ä¸­ï¼Œé’ˆå¯¹æ•°æ®åé€‰
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			if(chooseIds){
				return dTree.chooseDataInit(chooseIds);
			}
		},
		changeCheckbarNodes: function(dTree){	//åˆ¤æ–­å¤é€‰æ¡†æ˜¯å¦å‘ç”Ÿå˜æ›´
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.changeCheckbarNodes();
		},
		initNoAllCheck: function(dTree) { //å¤é€‰æ¡†åŠé€‰çŠ¶æ€åˆå§‹åŒ–è®¾ç½®
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.initNoAllCheck();
		},
		initAllCheck: function(dTree){ // å¤é€‰æ¡†é€‰ä¸­çŠ¶æ€åˆå§‹åŒ–è®¾ç½®
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.initAllCheck();
		},
		selectVal: function(dTree, param){  // selectæ¨¡å¼è®¾ç½®è¾“å…¥æ¡†é€‰ä¸­å€¼
			if(typeof dTree === "string"){
				dTree = DTrees[dTree];
			}
			if(typeof dTree === "undefined"){
				layer.msg("æ–¹æ³•èŽ·å–å¤±è´¥ï¼Œè¯·æ£€æŸ¥IDæˆ–å¯¹è±¡ä¼ é€’æ˜¯å¦æ­£ç¡®",{icon:2});
				return ;
			}
			return dTree.selectVal(param);	// selectæ¨¡å¼è®¾ç½®è¾“å…¥æ¡†é€‰ä¸­å€¼
		},
		escape: function(html){  // å­—ç¬¦ä¸²æ ¼å¼åŒ–
			return event.escape(html);
		},
		unescape: function(str){  // å­—ç¬¦ä¸²åæ ¼å¼åŒ–
			return event.unescape(str);
		},
		serialize: function(first, param) {  // åºåˆ—åŒ–JSONå¯¹è±¡
			return AjaxHelper.serialize(first, param);
		},
		version: function(){  //èŽ·å–ç‰ˆæœ¬å·
			return VERSION;
		}
	};

	exports('dtree', dtree);
});